in reply to working with \Q and \E
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^ :)'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: working with \Q and \E
by Roy Johnson (Monsignor) on Feb 24, 2005 at 20:37 UTC |