Forum Moderators: coopster

Message Too Old, No Replies

Regular Expressions

Don't you just love them ...

         

scriptmasterdel

4:45 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



Loosing my head here with regex, i have some content with some html and i want to extraxt my TD's with specific attributes as shown below.


preg_match_all('/<td width="190" height="175" align="center" valign="top">.+?<\/td>/', $content, $return);

However this doesn't work. I removed the last TD as as expected it returned an array of the opening TD tags.

What am i doing wrong? Pleas help webMasters!

Del

scriptmasterdel

6:07 pm on Nov 19, 2006 (gmt 0)

10+ Year Member



PROBLEM SOLVED!

It was that the content containerd new lines and the "." group doesn't replace them.

Thank anyway!

eelixduppy

1:26 am on Nov 20, 2006 (gmt 0)



Glad you figured out the problem! Remember to always refer to our Regex Tutorial [webmasterworld.com] if you get stuck.

And yes, I do love them! ;)

scriptmasterdel

10:41 pm on Nov 21, 2006 (gmt 0)

10+ Year Member



Cheers Bud ;-) Will do ...