Welcome to the Monastery | |
PerlMonks |
Re: Selectively replacing characters inside a stringby liverpole (Monsignor) |
on Jun 11, 2009 at 01:28 UTC ( [id://770496]=note: print w/replies, xml ) | Need Help?? |
Hi markkawika,
The first thing that comes to mind if you want to do it with regexes is to first capture the quoted part, and then change it:
Another way, if you're sure that the expression ends with the quoted expression, would be something very simple like:
Both result in:
Both are less simple than your solution, of course, but keep things within Perl, without resorting to using the shell. s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
In Section
Seekers of Perl Wisdom
|
|