Search for exact whole word within a string of words
I need to add a textbox to search the exact whole word, within a string of words. But only if it has that exact whole word and not be part of another word. Basically I need to set the spaces as the word boundary when looking for the search term.
For example if I have a name column that stores the entire name and I need to search for all names that have “Alan” in them.
John Alan Doe
Johnny Smith
Alana Miller
Sally Johnson
Alan Alda
If I use Includes to compare, it would return 3 names including Alana Miller. If I use = to compare, it would return nothing.
The desired return would be the 2 names (ignoring Alana Miller):
John Alan Doe
Alan Alda
Is this possible or should I be using preg_match some how? I see that preg_match is already built into WA.
Thanks,
TroyD