Jump to content

[SOLVED] preg_match_all regex problem...I just want everthing in between


atticus

Recommended Posts

Try making that + quantifier lazy (.+?), otherwise, if there is multiple p tags in that line, the dot will greedily match all the way to the end, then backtrack till it matches the final </p> (which may not be the correct one).

 

You can read about the pitfalls of greedy quantifiers here (post #11 and #14 helps illustrate this).

And as raj mentioned.. possibly using the s modifier might help (assuming your p tag is spead across multiple lines).

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.