common reg. exp. for validation rules

gibby

New member
Local time
Today, 15:52
Joined
Oct 3, 2004
Messages
7
Hey there,

Is there a listing anywhere online for common regular expressions for validations rules? In other words, is there something that shows how to construct validation rules for things like phone numbers, addresses, postal/zip codes, serial numbers, math equations, etc. Two in particular that I'm looking for are phone numbers and postal/zip codes. Every time I try to wrap my head around the formula for a phone number (with area codes, an optional 1 in the begining, making sure no leading zeroes, making brackets around area codes optional, etc.) I only get a headache :mad: . I'll get it eventually, but a quick reference in the mean time and for future use would be very helpful.


Thanks so much,

Gibby :)
 
You've probably tried this but:
- google search
- for phone numbers (and others?) max length, possibly think about forcing the user to enter into several fields and concatenate the result together into one text field... EG: Check for brackets (and remove), Check length, if passed then check for leading zero, groupings etc....

Once you get the rules, store a link in your favourites or in a separate html file for future reference, and possibly download the pages again for reference.

Read up on Replace function to remove brackets and spaces to leave you with one (text) number to deal with.


Vince
 

Users who are viewing this thread

Back
Top Bottom