weina67 Posted July 23, 2009 Share Posted July 23, 2009 so I'm having so much trouble understanding preg_match. I'm trying to use curl to request data from quantcast.com for sites like google.com and then use php to parse the html output. For example, the html embodies the following: <tbody> <tr class="current "> <td class="title"> <a href="/https/forums.phpfreaks.com/digg.com"> digg.com </a> </td> <td class="reach digit"> 12.6M <p class="label"> Monthly US People</p> </td> How do I parse the code to get the 12.6M Month US People? I want to get the "12.6" from the html code above. What preg regular expression should I use? I'm so confused! Anyone who could help, I would be so grateful. Thanks Just to clarify ... I wanted to use preg_match. Like parse the code $regexp = '#<td class="reach digit">(.*?)</td>#si'; preg_match($regexp, $response, $matches); to get the 12.6M. But I keep using the wrong regular expression so $matches arrays remains empty. Link to comment https://forums.phpfreaks.com/topic/167165-quantcast-regex-help/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.