On 1/12/2011 8:24 AM, Randal Rust wrote:
I am admittedly not very good with regular expressions. I am trying to
pull all of the paragraphs out of an article, so that I can create
inline links. Here is my script:

$blockpattern='/<p*[^>]*>.*?<\/p>/';
$blocks=preg_match_all($blockpattern, $txt, $blockmatches);

This returns 0.

Shouldn't the expression be:

$blockpattern='/<p[^>]*>.*?<\/p>/';

I removed the * after the first p.

Dan

_______________________________________________
New York PHP Users Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/Show-Participation

Reply via email to