Hi all Im new to regular expressions so please forgive me. I have a field which is a price of a particular object and I would like to validate that the value is OK. Obviously a price can look like this
45,000.00
what I would like it do is validate that the value has been entered like the above. Is there any examples out there that could do this. I have googled regular expression + floating number + php and various combinations of this and to no avail. I did find something along the following lines
[code=php]if (!(eregi(‘b[0-9]{1,3}(?:,?[0-9]{3})*(?:.[0-9]{2})?b’, stripslashes(trim($_POST[‘price’]))) )) {
$errors[] = ‘<font color=”white”>The overall Price of the Land Investment</font>’;
}
but this doesnt seem to work.
regards
Mike