Regular expressions to find number before link?

Discussion in 'Programming' started by tbarr60, Mar 12, 2008.

  1. #1
    tbarr60, Mar 12, 2008 IP
  2. Randombase

    Randombase Peon

    Messages:
    224
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Didn't test, but assuming you have the content of that google page in $googlecontent :
    <?php
    $data = explode("<nobr>",$googlecontent);
    foreach($data as $line)
    {
    	if(preg_match("/www\.salarymap\.com/",$line))
    	{
    		if(preg_match("/([0-9]){1,}/",$line,$regs))
    		{
    			print $regs[1];
    		}
    	}
    }
    ?>
    PHP:
    This is a VERY big guess and not really a good regex example :$
     
    Randombase, Mar 12, 2008 IP