Wouldn't anchoring the pattern at the end of the string with \z or one of its ilk (e.g., m{ pat \z }xms) tend to be faster since the .* doesn't need to 'consume' virtually the whole file? Or is this the kind of thing that just gets optimized away?
Update: Contrary to krish28's clarification in Re^2: Matching Regular expression at EOF, this question assumes the entire file is held in a single string. But the question still stands.
In reply to Re^2: Matching Regular expression at EOF
by AnomalousMonk
in thread Matching Regular expression at EOF
by krish28
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |