Suppose you know an exact substring that occurs before the match. Then you can find it's position with rindex, set pos to that value, and add \G.* in front of your regex.
In reply to Re: Optimizing a regex that replaces near the end of a string
by moritz
in thread Optimizing a regex that replaces near the end of a string
by perl5ever
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |