Note that this does as you define it: only replace it when surrounded by whitespace. It will not replace the user name if the name starts or ends the line.s/(\s)\Q$user\E(\s)/${1}xxxx${2}/;
In reply to Re: Regular Expression Help matching white space but not replacing it
by JavaFan
in thread Regular Expression Help matching white space but not replacing it
by elanghe
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |