Quick RegEx Question
| From: | Jeff Oien | Date: | Sat, 31 Mar 2001 17:36:17 +0000 |
| Subject: | Quick RegEx Question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-46449@lists.php.net to get a copy of this message | ||
I want to check if a variable contains a price, like
$19.99
It definitely would be a dollar sign, two integers a dot and
two integers. Here is what I tried which doesn't work.
if (ereg("\$([0-9]{2}).([0-9]{2})", $Price))
or
if (ereg("\$([0-9]{2})\.([0-9]{2})", $Price))
Thanks.
Jeff Oien