#39857 [Opn->Bgs]: Ereg(i) returns irrelevant result

From: Date: Sun, 17 Dec 2006 18:27:16 +0000
Subject: #39857 [Opn->Bgs]: Ereg(i) returns irrelevant result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106444@lists.php.net to get a copy of this message
ID: 39857 Updated by: iliaa@php.net Reported By: adult at adult-inc dot biz -Status: Open +Status: Bogus Bug Type: Regexps related Operating System: Fedora core 5 PHP Version: 5.2.0 New Comment: Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php your regex allow for 2 numbers tom be matched. So it matches 20 and returns TRUE indicating success. Previous Comments: ------------------------------------------------------------------------ [2006-12-17 00:03:37] adult at adult-inc dot biz Description: ------------ Ereg and eregi functions returns irrelevant results Reproduce code: --------------- if (ereg("[9876543210]{2,6}", "2006-12-17")) echo "BUG"; else echo "OK"; Expected result: ---------------- OK Actual result: -------------- BUG ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39857&edit=1

« previous php.bugs (#106444) next »