note 40094 added to function.ereg
| From: | php-general at lists dot php dot net | Date: | Sat, 21 Feb 2004 17:29:54 +0000 |
| Subject: | note 40094 added to function.ereg | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-65489@lists.php.net to get a copy of this message | ||
Here are some examples that I have done:
Check a US Phone Number: (xxx) xxx-xxx OR xxx-xxx-xxx
^([2-9][0-9]{2}-[2-9][0-9]{2}-[0-9]{4}|\([2-9][0-9]{2}\)\ [2-9][0-9]{2}-[0-9]{4})$
Check a Username or Password (Letters and Numbers only, first character must be a letter, 4 to 36
characters in length).
^[a-bA-B][a-bA-B0-9]{3,35}$
Check an email address
'^[a-zA-Z0-9_\.\-]{1,*}@[a-zA-Z0-9_\.\-]{2,*}.[a-zA-Z]{2,4}$';
I hope thease can help some people out there :)
----
Manual Page -- http://www.php.net/manual/en/function.ereg.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+40094
Delete -- http://master.php.net/manage/user-notes.php?action=delete+40094&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+40094&report=yes
Search -- http://master.php.net/manage/user-notes.php