Page 1 of 1

force word search

Posted: Wed Apr 08, 2026 6:19 pm
by carlseibert
Hi,

Is there a way to constrain a search to whole words? A search for "cat" will return "Catalina" and "concatenate" as well as "cat". If I just want the animal, I'm used to searching for ' "cat" ' with double quotes and getting just cats. Can I do this somehow in NeoFinder?

Don't get me wrong, I appreciate being able to search strings rather than words because, for example, I can usually search for singular and plural in one go, as well as other useful cases. It's just that sometimes, I feel the need to go the other way. A search for "tim", for a real example, returns "estimate" and "time", common enough words to cause a problem.

-Carl

Re: force word search

Posted: Tue Apr 14, 2026 4:19 pm
by neo-admin
That is an interesting point, and we will discuss it here in our next developers meeting!

Re: force word search

Posted: Thu Apr 16, 2026 4:35 pm
by carlseibert
Actually, I think I may have answered my own question.

In the Find Editor, NeoFinder searches literal strings. If I search "SPACEsearchTermSPACE", I get a return that includes the searched word but not words where it is merely a string in another word. In other words, "cat" instead of "concatenate".

I worry about the leading space. What if the search term is the first word in a field? But I've tried testing this and it seems not to matter. Why not, I have no clue. But whatever works!

That said, I think the technique will still be effective most of the time (and no search strategy is 100% effective) if we use only the trailing space. In English, at least, the problematic string is often at the end of the word being searched - "Josephine" for Joseph, or "catastrophe" for"cat".

Thinking about potential pitfalls, it would seem that my technique would fail if the search term is directly followed by punctuation, say, at the end of a sentence. Maybe if there was a way to add a wildcard before or after the space?

-Carl

Re: force word search

Posted: Thu Apr 16, 2026 7:14 pm
by carlseibert
Update: I'm afraid of regular expressions so this is very scary for me.

[ \p{P}]searchTerm[ \p{P}] seems to work if I choose Any Text and regex.

The leading expression, like the space, doesn't seem to bother things if the search term is the first word in the field (in this case Caption). I still have no clue why not, and I guess as long as it works, I shouldn't care.

Of course, just being able to use double quotes would certainly be better and easier.