Note that .* is equivalent to [^\n]* if you're not using /s. I added the * at the end, because it fits the /dict/words lookup.while ($mmap =~ m/\n?(.*$pat.*\n)/omg) {
Removing the ? at the beginning makes it even faster, but then you need to handle the first line specially.
In reply to Re: Surprisingly poor regex performance
by Joost
in thread Surprisingly poor regex performance
by sgifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |