Shouldn't
[^\n]\n
be
[^\n]*\n
I don't know if that'll help your performance problem.
This post may not have anything to do with mmap. Did you try it without using mmap?
In reply to Re: Surprisingly poor regex performance
by ikegami
in thread Surprisingly poor regex performance
by sgifford
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |