Im trying to match a pattern and extract some values... im having some problems...
This is what i have at the moment...
Code: Select all
$page = file_get_contents("http://www....");
preg_match( "/[\w\s]+[\w\s]+[\w\s]+[\w\s]+[\w\s](\d{3}\s+)(\d+\.\d\s+)[\d+\.\s+)]+(\d\.\d\s+)(\d)/i", $page, $matches);41001 2006 02 20 11 220 3.0 6.0 1.6 9
My code is producing the result, 220 3.0 1.6 9, which is correct! however the values are constanly changning, and sometimes the 6.0 value above becomes 'MM' which obviously messes up the pattern. What do i need to do to the pattern to allow for both possiblities...?
I also need to verify that the string starts with the first value of 41001 exactly, how can this be done?
Thanks very much...