I have to check if the substring exist in the someString. First, I tried to solve the problem in the following way. someString.contains(substring).but it’s not worked as expected, if i tried to find word “ours” and there was “hours” I got “true” … Now I am using regexp “\b(substring )\b” , it’s work nice, but if someSting contains something like U.S. N.Y. and i am trying to check if this substring (with dots) exist - I get false.
Please help me improve regexp. Thank you