need a regex exp that check if a word is present in a string(entire word should only be present and not substring in a word)
Let a = " raju’s shoes are black"
Let x = "are"
Let regex = new regex("//b"+x+"//b")
regex.test(a). // returns true which is expected
If x is "s", regex.test(a) returns true but should actually be false since s is not a separate word in string a but the regex exp is treating so
How can I fix the regex expression so regex can ignore such special characters or consider only space as between words as new word