simplify a regex to reduce recursion -


i have regex this:

/^from: ((?!\n\n).)*\nsubject:.+/msu 

with point of matching block looks this:

from: john smith cc: jane smith subject: cat videos 

(ie- they're in contiguous block) not if there blank line breaking block, this:

from: john smith  subject: cat videos 

but i've been finding php script uses segfaulting. able mitigate segfaults setting pcre.recursion_limit lower number (i used 8000), occurs me i'm trying should doable without great deal of recursion. using horribly inefficient method of catching \n\n ?

i use "not newline":

/^from:[^\n]*\nsubject:.+/msu 

Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -