s/\bold\b/new/gi;, just like Skeeve said. :)
It might help you to remember that the boundary matcher is a so-called "zero-width assertion", which only appears on the left-hand side of a substitution. The newline (\n) and other special sequences that involve formatting and printing can be on both sides. That's because Perl treats the regular expressions like double-quoted strings. You can get more info on this by doing perldoc perlre at the shell/command prompt.
HTH
--
Allolex
In reply to Re: boundary reg expression
by allolex
in thread boundary reg expression
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |