Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

user regexps

Quote Reply
user regexps
ok.. i wanted to come up with a few REGEXPs to use for the user database.. but i am unaware of "international" formats..

first off.. the two ones i'm trying to figure out are Zipcode and Phone number..

in the US.. zipcode can be...

00000 or 00000-0000

which in REGEXP can be.. ^\d{5}-?\d{0,4}$

are there any other formats?

also.. phone numbers.. i'm not quite sure about country codes and stuff.. cause i'm just a kid.. but i really need help here Smile

in the US.. phones numbers can look like many things.. the more common one is.

000-000-0000 but if you wanted to include the country code.. 1-000-000-0000

i'm guessing that country codes are more than just one number in some countries..

what other formats of telephones are there?

in these cases.. the regexp '^\d{1,3}-\d{3}-\d{3}-\d{4}$'

would work..

thanks for your help!


------------------
Jerry Su
Links SQL Licensed
------------------
Subject Author Views Date
Thread user regexps widgetz 2905 Jan 18, 2000, 10:50 AM
Post Re: user regexps
dan 2786 Jan 18, 2000, 10:55 AM
Post Re: user regexps
widgetz 2788 Jan 18, 2000, 6:51 PM
Post Re: user regexps
widgetz 2802 Jan 18, 2000, 9:23 PM
Post Re: user regexps
Alex404 2793 Jan 18, 2000, 10:44 PM
Post Re: user regexps
herbalife 2799 Jan 19, 2000, 4:39 PM