I have this preg_match_all
:
$cash = "hi £240";
preg_match_all("/^£?(([1-9]{1,3}(,\d{3})*(\.\d{2})?)|(0\.[1-9]\d)|(0\.0[1-9]))$/", $cash, $matches);
print_r($matches);
And the print_r returns:
Array ( [0] => Array ( ) [1] => Array ( ) [2] => Array ( ) [3] => Array ( ) [4] => Array ( ) [5] => Array ( ) [6] => Array ( ) )
When I tried just preg_match, it didnt work at all, did I miss something?
I am searching the string for GB monetary values.