Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Regex::Reverse tricky test casesby Roy Johnson (Monsignor) |
on May 17, 2005 at 13:11 UTC ( [id://457783]=note: print w/replies, xml ) | Need Help?? |
sexeger.
Some patterns — notably those with negative lookbehinds, which cannot be variable-length, but also others — work better backwards. Yes, you have to reverse the string to be matched, as well as the regex, and then you have to reverse whatever you captured. Sometimes it's still a win. Caution: Contents may have been coded under pressure.
In Section
Seekers of Perl Wisdom
|
|