A "word boundary" denotes one of three possible positions:
- before the first character in a string (if the first character is a word character)
- after the last character in a string (if the last character is a word character)
- between two characters in a string (where one is a word character and the other is not)
\b allows you to perform a word boundary. To negate this, use
\B, meaning "not at word boundary".
Some regular expression engines also support
\> for start-of-word and end-of-word boundaries.