Jump to content

Is my regex right ? - trying to capture the link


Nuv

Recommended Posts

I am trying to capture the href link from one of the sites.The part of the source code is as follows

 

 

<tr bgcolor="#CCCCCC"> 
<td align=right></td> 
<td align=center valign=center width=10><a href="/info/link1">

 

I am using

 

 preg_match_all('~<tr\sbgcolor="#CCCCCC">\s<td\salign=right></td>\s<td\salign=center\svalign=center\swidth=10><a\shref="(.*)">\siU~', $data, $link); 

 

However $link isn't storing anything. Is my regex right ?

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.