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

From: Date: Mon, 18 Dec 2006 00:37:10 +0000
Subject: #39857 [Bgs]: Ereg(i) returns irrelevant result
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-106449@lists.php.net to get a copy of this message
ID: 39857 User updated by: adult at adult-inc dot biz Reported By: adult at adult-inc dot biz Status: Bogus Bug Type: Regexps related Operating System: Fedora core 5 PHP Version: 5.2.0 New Comment: Sorry, had a hard work that day :) That's what i need: ereg("[^0-9$]{2,6}", "2006-12-17") Previous Comments: ------------------------------------------------------------------------ [2006-12-17 18:27:15] iliaa@php.net 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. ------------------------------------------------------------------------ [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 (#106449) next »