"Contains" finds similar words, not the excact word

Helllo! :slight_smile:

I want to search sentences typed in a text field for specific words. I use “Contains” for this in my blueprint.

However, I want to search the sentence for EXACT words.
The problem: “Contains” also finds similar words & not just the exact word.

Example: I want to search for the word “run”. However, “Contains” also returns true if the sentence contains e.g. RUNner, RUNing etc. I can’t find a way to ensure that only the exact word is found without manually excluding all possible word combinations.

(Placeholders are of no use either, since the words are then ignored again due to possible punctuation marks).

Anyone have an idea?

PS: Please try to explain for blueprints, not for C++ :smiley:

1 Like

What if you searched for the the word + space (because it’s the most common):

image

(Placeholders are of no use either, since the words are then ignored again due to possible punctuation marks).

And then create a map of what other punctuation is allowed to follow.

1 Like

With Space, the words were no longer recognized with punctuation marks.

Blockquote And then create a map of what other punctuation is allowed to follow.

But this could be a very good idea, how would it work related to “contains”?
Would it also be possible to filter the punctuation marks local related to the Equal (case insensitive) node?

(I need the punctuation marks sometimes, so I can’t filter them out completely)

greetings

1 Like

Small Thought of mine:

You know your search substring… so you know it’s length?

idea:
Get the Length of your substring, and compare the length of each result of the Contains, against…
if the length matches, it is a high chance that it is the word you searched for.

4 Likes

You are so genius, this is even better!

2 Likes