Probably it's the \b that's screwing you up. Read perldoc perlre for the full explanation, but basically it means a point in the string where there's a transition from a \w character to a \W character (or vice versa). This condition doesn't exist for ":)" so the regex doesn't match and your substitution won't be done.
DB<4> $_ = ":) cat :)" DB<5> s/\b/^/g DB<6> x $_ 0 ':) ^cat^ :)'
In reply to Re: working with \Q and \E
by Fletch
in thread working with \Q and \E
by coldfingertips
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |