|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39857 Ereg(i) returns irrelevant result
Submitted: 2006-12-17 00:03 UTC Modified: 2006-12-18 00:37 UTC
From: adult at adult-inc dot biz Assigned:
Status: Not a bug Package: Regexps related
PHP Version: 5.2.0 OS: Fedora core 5
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: adult at adult-inc dot biz
New email:
PHP Version: OS:


 [2006-12-17 00:03 UTC] adult at adult-inc dot biz
Ereg and eregi functions returns irrelevant results

Reproduce code:
if (ereg("[9876543210]{2,6}", "2006-12-17"))
	echo "BUG";
	echo "OK";

Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-17 18:27 UTC]
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at and the instructions on how to report
a bug at

your regex allow for 2 numbers tom be matched. So it matches 
20 and returns TRUE indicating success.
 [2006-12-18 00:37 UTC] adult at adult-inc dot biz
Sorry, had a hard work that day :)
That's what i need: ereg("[^0-9$]{2,6}", "2006-12-17")
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Sat Dec 09 00:01:27 2023 UTC