|
|
| Just another Perl shrine | |
| PerlMonks |
Re: Swapping two parts of a stringby GrandFather (Saint) |
| on Jul 22, 2007 at 20:53 UTC ( [id://628146]=note: print w/replies, xml ) | Need Help?? |
|
Capture the two strings to be swapped using a regex then put them back together in opposite order:
Note that the /x allows the spaces to be used to break up the expression for easier understanding. DWIM is Perl's answer to Gödel
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||