Bug #15070: ereg() not matching properly.

From: Date: Wed, 16 Jan 2002 17:24:38 +0000
Subject: Bug #15070: ereg() not matching properly.
Groups: php.dev 
Request: Send a blank email to php-dev+get-77268@lists.php.net to get a copy of this message
From: mking@aspre.net Operating system: Linux (Cobalt) PHP version: 4.0.6 PHP Bug Type: Regexps related Bug description: ereg() not matching properly. I'm having weird problems with ereg(). Look at the following code. There is no reason that ereg() should return false with the value ("1.99"). It does. It returns true with "1.90". This pattern should return true for (in english): 0 or more of anything, one "." exactly, two digits exactly, 0 or more of anything I think there may be a problem with the regex libraries. This worked in 4.05, but now does not work with 4.06 $vTmp = "$1.99"; // "$1.90" works!!! settype($vTmp, "double"); if(ereg(".*\.[0-9][0-9].*",$vTmp)) { // handle error }else{ // continue } -- Edit bug report at: http://bugs.php.net/?id=15070&edit=1

« previous php.dev (#77268) next »