![]() |
|
Welcome to the Monastery | |
PerlMonks |
Re: Can this be a 1 line or simpler regex?by diotalevi (Canon) |
on Apr 05, 2003 at 07:35 UTC ( #248270=note: print w/replies, xml ) | Need Help?? |
(fixed the code) I suppose a single regex could be devised for this but it'd be suboptimal compared to what you already have. A short loop would also do this and again, I prefer your original. $text =~ s/\\$r/\\\\$r/g for qw/t n r f/;
In Section
Seekers of Perl Wisdom
|
|