I'm working on a script to pull data from dmoz.org. Here is the string I'm trying to isolate: <b>Open Directory Sites</b></font> (1-20 of 395) The number in red is what I have to assign to $1 for it to work with my script ($1 is used in other calculations, so it has to be assigned to that). I've tried these two patterns and it's not matching for either: /Open Directory Sites<\/b><\/font> [.*] of (.*)/Us /Open Directory Sites<\/b><\/font> \([0-9]-[0-9] of (.*)\)/Us Any suggestions? Remember, the number in red that I'm trying to match has to be $1.
$a = "<b>Open Directory Sites</b></font> (1-20 of 395)"; preg_match('@Open Directory Sites</b></font> \(.* of (.*?)\)@',$a, $b); print_r($b);