You need the $1 and $2 to retain your symbols. update symbols between square brackets according to your wishes$newstring =~ s/([+<-/)*>])HELL([+<-/)*>])/$1BAD$2/g;
Cheers
Sam
In reply to Re: string substitution
by seaver
in thread string substitution
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |