Addition to stribizhev answer .. you can use (:\))\B
Examples of using:
\b : string = That man is batman. regex = \bman\b matches only man , not man in batman , because the position between tm not a word boundary (this word).
\b : string = I am bat-man and he is super - man. regex = \B-\B matches - in super - man , while \B-\B matches - in bat-man , since the position between t- and -m is the word boundary .. and (space) - , - (space) not.
Note. . It's easy to see if you consider \b or \b as the position between two characters, and if the transition from character to character is equal to word to word or word to non word
source share