in reply to Re: Re: boundary reg expression
in thread boundary reg expression

Add a boundary to the beginning and that should do the trick (watch out for words like FOLD, TOLD, etc). Also note that you don't need to write a full Perl script to make the changes to the files in question. You can do this with a one-liner:
perl -pi -e's/\bOLD\b/NEW/g' *.txt
And if you are paranoid and want to keep the orignals:
perl -pi.bak -e's/\bOLD\b/NEW/g' *.txt
will preserve them with a .bak "extension" added to the end of the filename. (For example, foo.txt becomes foo.txt.bak)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)