in reply to Optimizing a regex that replaces near the end of a string
What's a good way to write the regular expression so that perl will start searching from the end of the string?
That's what end anchors ($, \z, \Z) are for... And if you only need to do a simple substring search, you can also use rindex().
|
|---|