tags:

views:

24

answers:

1

I tried the following at http://gskinner.com/RegExr, there it worked perfectly. Now I want to get the /(?<=>\r\s{23})(.*)/gi pattern realized in PHP. The > character don't perform well, also not with backslashes...

I want to get the &nbsp;&nbsp;2011&nbsp;Oct&nbsp;3, Mon, Unity Day and &nbsp; in the mid of every <FONT></FONT>.

Searching string:

      `<TR>
         <TD ALIGN=LEFT VALIGN=MIDDLE HEIGHT=17 
              WIDTH=175  BGCOLOR=lightblue>
               <FONT COLOR=red SIZE=2>
                   &nbsp;&nbsp;2011&nbsp;Oct&nbsp;3, Mon
               </FONT>
         </TD>
         <TD ALIGN=LEFT VALIGN=MIDDLE HEIGHT=17 
              WIDTH=150 BGCOLOR=lightblue>

         <FONT COLOR=black SIZE=2>
                   Unity Day
               </FONT>
         </TD>
         <TD ALIGN=LEFT VALIGN=MIDDLE HEIGHT=17 
              WIDTH=275 BGCOLOR=lightblue>
         <FONT COLOR=black SIZE=2>
                   &nbsp;
               </FONT>
         </TD>

     </TR>`

Any ideas, other solutions, etc.?

Greetings Eminenz

+1  A: 

This will be echoed many times on stack overflow - don't use regex to parse XML/HTML.

Check out the DOM parser: http://www.w3schools.com/php/php_xml_dom.asp

Jamie Wong
Thank you!I will have a look on that.
Eminenz