php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15070 ereg() not matching properly.
Submitted: 2002-01-16 12:24 UTC Modified: 2002-02-11 17:22 UTC
From: mking at aspre dot net Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 4.0.6 OS: Linux (Cobalt)
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
30 + 17 = ?
Subscribe to this entry?

 
 [2002-01-16 12:24 UTC] mking at aspre dot net
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
} 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-02-11 17:21 UTC] mking at aspre dot net
I'm reopening so someone can bogus this bug. (I don't seem to have that option).
 [2002-02-11 17:22 UTC] derick@php.net
Bogusify on request
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed May 08 21:01:33 2024 UTC