in reply to Re^3: maximum number of lines for negative lookahead assertion (?!)
in thread maximum number of lines for negative lookahead assertion (?!)
Keep in mind this is a simplification of his actual code, with extra code added for debugging. He followed proper PM etiquette by posting the miminum code which causes the problem, whether the code itself makes sense or not on its own.
For example, the /g is useless in this example, since $line will always be matched in its entirety. In the real program, he would have something different in the body of the inner while.
The captures are also nonsense. The regexp should read
/^>(.*)\n((?:^(?!>).*\n)+)/gm
instead of
/^(>.*)\n(^(?!>).*\n)+/gm
if he wishes to capture anything.
|
|---|