I currently have a regex like this:
/^From: ((?!\n\n).)*\nSubject:.+/msu
with the point of matching a block that looks like this:
From: John Smith
Cc: Jane Smith
Subject: cat videos
(ie- where they're in a contiguous block) but not if there is a blank line breaking up the block, like this:
From: John Smith
Subject: cat videos
but I've been finding that my PHP script that uses this is sometimes segfaulting. I was able to mitigate the segfaults by setting pcre.recursion_limit to a lower number (I used 8000), but it occurs to me that what I'm trying to do should be doable without a great deal of recursion. Am I using a horribly inefficient method of catching the \n\n ?
[^\n]\nSubjector something similar.