this regular expression is acting funny
Posted: Mon Jun 17, 2002 11:49 pm
Ok, i made an expression to allow numbers in the format $123,456,789.99
but for some reason 3 and 5 do not run correctly. $3 and $5 do.
here is my code:
3 and 5 cause $wasANError to be 1 but $3 and $5 dont. Whats going on?
but for some reason 3 and 5 do not run correctly. $3 and $5 do.
here is my code:
Code: Select all
<?
if(!ereg("^(\\$)?(ї0-9]+|ї0-9]{1,3}(,ї0-9]{3})*)(\.ї0-9]{1,2})?$", $price)) {
$invalidPriceMessage = "Price must be a number.";
$wasAnError = "1";
}
echo "$wasAnError";
?>