I was using the standard \b
word boundary. However, it doesn't quite deal with the dot (.) character the way I want it to.
So the following regex:
\b(\w+)\b
will match cats
and dogs
in cats.dog
if I have a string that says cats and dogs don't make cats.dogs
.
I need a word boundary alternative that will match a whole word only if:
- it does not contain the dot(.) character
- it is encapsulated by at least one space( ) character on each side
Any ideas?!
P.S. I need this for PHP