in reply to Optimizing a regex that replaces near the end of a string
Another technique I've used with some success is simply calling reverse() on the string, running the regex, and then reversing again. You'll want to benchmark against your typical input, of course.
|
---|
In Section
Seekers of Perl Wisdom