Just another comment, since
blake's and
staeryatz's has pointed something like that.
\b is the word boundary, and is zero length.
It can be said that
\b is "the nothing before and after a word"
Because of that, it is indiferent to code
/\b($pattern)\b/
or this
/(\b$pattern\b)/
I agree with
blake, the first is better readable for me.
Hopes