in reply to Word boundaries

Hello, sandyago.

In regular expression syntax many flags are paired upper- and lower-case letters, one signifying the opposite of the other.

In this case \b matches a boundary between a word character and a non-word character, while \B matches anything else.

$ perl -E' for ("cat","a dog") { say if /\ba/; } '
a dog
$ perl -E' for ("cat","a dog") { say if /\Ba/; } '
cat
See perlretut for an introduction to regular expressions.

The way forward always starts with a minimal test.