in reply to regex causing segmentation fault (core dump)
As Tanktalus says, this is almost certainly caused by recursion going past the end of the available stack space. I expect that it is caused specifically by the very first fragment of your regexp:
.. the first time you try to use it on a file that has a few thousand lines not matching the next part of the pattern.(?:.*\n)*?
Since that fragment has no effect other than to ensure the rest of the pattern is anchored to the start of the line, I would suggest replacing:
with:m/(?:.*\n)*?rest of pattern/
which I believe will solve your problem.m/^rest of pattern/m
Hugo
|
|---|