Try:
$blockpattern='/<p*[^>]>.*?/m'; Notice the m after the last / this says it can span multiple lines.... ----- Original Message ----- From: "Randal Rust" <randalr...@gmail.com> To: "NYPHP Talk" <talk@lists.nyphp.org> Sent: Wednesday, January 12, 2011 9:06:44 AM Subject: Re: [nyphp-talk] Regex for P Elements Trying to work my way through the expression, to see where it fails. If I use this: $blockpattern='/<p*[^>]*>.*?/'; It returns 116 matches, but if I take out that extra *, as you suggested Dan... $blockpattern='/<p*[^>]>.*?/'; ...I get 33 matches, which is correct. However, when I add the rest of the expression, like this... $blockpattern='/<p*[^>]>.*?<\/p>/'; I still get 0 results from preg_match_all. _______________________________________________ New York PHP Users Group Community Talk Mailing List http://lists.nyphp.org/mailman/listinfo/talk http://www.nyphp.org/Show-Participation