Is there any way to achieve this with a single s/// operation?
How about with zero s/// operations? (Use tr/// instead :)
[0] Perl> $s = 'x x x a x x x b x x x a x x x b x x x';; [0] Perl> $s =~ tr[ab][ba];; [0] Perl> print $s;; x x x b x x x a x x x b x x x a x x x
In reply to Re: Multiple replacements with the exception of previously made replacements.
by BrowserUk
in thread Multiple replacements with the exception of previously made replacements.
by jthiel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |