[thelist] JS regex help

Paul Bennett paul at web-business-pack.com
Thu Oct 7 18:17:52 CDT 2004



Edwin Horneij wrote:

>
>
>Better make it "{2,6}". ".museum" is a TLD.
>  
>
(Not trolling, promise....)

which begs the question, what happens 2 years down the track when a 7 
letter tld is added? What about .museum.nz? (valid 2nd level domain)?

There are two types of data checks:
(1) Check for the data you don't want - bad chars, messed up syntax etc 
- let all else through.
(2) Check for what you will allow - specify a rigid format and block 
anything that doesn't conform.

Typically, for web applications, the second option is better, 
specifically when the data must be in a determined format. Unfortunately 
for email addresses there is so much variation, that validating every 
conceivable value brings out issues such as the ones discussed today.
Is there a point where we check for reasonable syntax and then just let 
the rest of the data through?



More information about the thelist mailing list