NYCPHP Meetup

NYPHP.org

[nycphp-talk] Question about REGEX's...

Anthony Papillion anthony at adcl.biz
Tue Nov 28 19:53:50 EST 2006


Thanks for the help...that worked. But, for some reason, the entire regex breaks down now. While I don't get an error, it seems to not be working as I get the entire text. Is my syntaxt wrong?

Thanks,
Anthony


----- Original Message ----- 
From: Paul Houle 
To: NYPHP Talk 
Sent: Tuesday, November 28, 2006 6:56 PM
Subject: Re: [nycphp-talk] Question about REGEX's...


Anthony Papillion wrote:
> Hello Everyone,
>  
> I am using the following regex to retrieve text between two <div> tags.
>  
> $trans_text = preg_match(/<div id=result_box dir=ltr>(.+?)</div>/);
>  
> However, the parser keeps telling me it expects a ) but found / 
> instead. What am I doing wrong?
    It's probably the / in /div.  Try

...<\/div>/


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

NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com

Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nyphp.org/pipermail/talk/attachments/20061128/1da9358e/attachment.html>


More information about the talk mailing list