[edited for hopefully more clarity.]
I'm probably confused, but I have a Mongodb dataset of simple words:
Items:
Boston Beer
Boston Brewery
Coors Brewing Light
I have an input string:
"Boston Beer Company"
I want to find any item That is contained within the input string. In this case, 'Boston Beer' would be a match.
The trouble is, given any input string, I don't know which words in the string would find a match in a field. (The match is not anchored to the beginning or end.)
In Javascript, I'd just create a loop and test.
inputString.indexOf(currentItem) >= 0
I may have confused myself, but I can't find a way to express a regEx where the RegEx is the target string and I am testing if any individual item (field) is contained within the longer string.
I hope this is somewhat clearer.
Thanks in advance-