note 49927 added to function.ereg
| From: | Carrajola at osu1 dot php dot net | Date: | Sat, 12 Feb 2005 06:54:26 +0000 |
| Subject: | note 49927 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-84892@lists.php.net to get a copy of this message | ||
Since the example has the purpose of validating the date in $date and not just change it, the
regular expression is not accurate, because a date like 0000-00-00 is validated.
It should be something like this:
(19[0-9]{2}|20[0-5]{2})-(0[0-9]|1[0-2])-([12][0-9]|3[01])
this regular expression is still not totally correct because it's not sensible to a impossible
date like 2005-02-31.
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49927
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49927&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49927&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49927&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49927&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49927&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49927&report=yes
Search -- http://master.php.net/manage/user-notes.php