[thelist] JS regex help

Courtenay court3nay at gmail.com
Thu Oct 7 19:41:46 CDT 2004


Also remember that people use the plus symbol in their emails to
filter mail into relevant folders client-side, (this is apparently
valid syntax) i.e.

  johnsmith+personal at mail.com

so your     [a-z_\.] 
becomes    [a-z_\.+] 

or even (this is scrappy, someone can do better than this) 
[a-z_\.][+]?[a-z_\.]?

and the  (\.[a-z]{2,4})(\.[a-z]{2})*$)   (which checks for .aa.bb at
the end of the string)
becomes [a-z]+[.][a-z]+  or [a-z]{2,1024}  (assuming sometime in the
future there will be reeeealy long top-levels.)

If you thought the discussion wasn't pedantic enough, remember also
that people may submit an email at an IP address.  Or an IPv6
Address?? if  your toaster/fridge can receive email, in 2008.

maryjane at 212.25.35.66

Maybe there's a more complete pre-rolled regexp out there.  My
personal favourite site is http://regexp.info  (hah! four-letter TLD).
 I think I'm further along 'troll' than Paul :)



On Fri, 08 Oct 2004 12:17:52 +1300, Paul Bennett
<paul at web-business-pack.com> wrote:
> 
> 
> 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?
> 
> 
> 
> --
> 
> * * Please support the community that supports you.  * *
> http://evolt.org/help_support_evolt/
> 
> For unsubscribe and other options, including the Tip Harvester
> and archives of thelist go to: http://lists.evolt.org
> Workers of the Web, evolt !
>


More information about the thelist mailing list