Extended Patterns regular expressionsmy $str = "|90|93|foo|bar|91|92|95|96|906|"; $str =~ s/(?<=\|)9[0-6](?=\|)/X/g; print "[ $str ]\n"; __END__ Also , you can go through this tutorial
In reply to Re: Replacing consecutive tokens in 1 pass
by OM_Zen
in thread Replacing consecutive tokens in 1 pass
by aarestad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |