I just came back after 10 days, and I see that I made a significant error in my previous post. It looks like the time allowed for editing it directly has passed, so here's the correction:
\b matches the empty space between word characters a word character and a non-word character...
In addition, while the explanation for \B
is correct as far as it goes, it is also incomplete. It matches the space between two word characters, or
between two non-word characters.
In other words, \b
matches if there's a transition between word and non-word, and \B
matches if there's no transition.