note 57127 added to function.ereg

From: Date: Sat, 24 Sep 2005 16:30:17 +0000
Subject: note 57127 added to function.ereg
Groups: php.notes 
Request: Send a blank email to php-notes+get-95713@lists.php.net to get a copy of this message
Here are some common ereg strings I used on our web site: US and Canada phones (1-555-555-5555 format) ^[0-9][-][0-9][0-9]{2}[-][0-9][0-9]{2}[-][0-9]{4}$ Integer values ^[0-9]+$ Canada Zip codes (G1C 1C1 format) ^[A-Z][0-9][A-Z][ ][0-9][A-Z][0-9]$ Email and SMS adresses: ^[a-z0-9][-_a-z0-9]*([.][-_a-z0-9]+)*[@]([a-z][.])? [a-z0-9][-_a-z0-9]*[.][a-z]{2,4}([.][a-z]{2,4})*$ First names and Last names ^[A-ZÄÁÂÀËÉÊÈÏÍÎÌÖÓÔÒÜÚÛÙÇ][a-zäáâàëéêèïíîìöóôòüúûùç]+ ([- ][A-ZÄÁÂÀËÉÊÈÏÍÎÌÖÓÔÒÜÚÛÙÇ][a-zäáâàëéêèïíîìöóôòüúûùç]+){0,2}$ Websites URL without arguments, login, password and port ^[h][t][t][p][:][/][/][a-z0-9][-_a-z0-9]* ([.][-_a-z0-9]+)?([.][a-z]{2,4}){1,2}$ I'm pretty sure they are not perfect but they work fine for us. I hope they will be useful to you! Andre Lebeuf STR ATMs and Terminals ---- Manual Page -- http://www.php.net/manual/en/function.ereg.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57127 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57127&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57127&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95713) next »