NYCPHP Meetup

NYPHP.org

[nycphp-talk] Regex for P Elements

Randal Rust randalrust at gmail.com
Wed Jan 12 08:58:46 EST 2011


On Wed, Jan 12, 2011 at 8:55 AM, Dan Cech <dcech at phpwerx.net> wrote:

> Shouldn't the expression be:
>
> $blockpattern='/<p[^>]*>.*?<\/p>/';
>
> I removed the * after the first p.

I'm sure that could be the case, but I figured out the problem,
literally just as your reply hit my inbox. The paragraphs had line
returns in them. I stripped those out with str_replace and now the
original regex works.

-- 
Randal Rust
R.Squared Communications
www.r2communications.com
www.facebook.com/r2communications
614-370-0036



More information about the talk mailing list