Prev: Anybody mind to translate this Felleisen quote from German to English
Next: Macros and anonymous functions
From: Robert Uhl on 8 Mar 2010 21:47 ccc31807 <cartercc(a)gmail.com> writes: > On Mar 1, 12:14 pm, Ron Garret <rNOSPA...(a)flownet.com> wrote: >> It detects valid email addresses. > > Which is over-kill for a common problem. > > Personally, I use something like /[\w.-]+@[\w]+\.[\w]{2,4}/ > which matches as follows: > - at least one alphanumeric character, dot, or dash > - exactly one "@" > - at least one alphanumeric character > - exactly one "." > - from two to four alphanumeric characters > and fits into the category of "good enough" No, no, no, no! It fails to match '+' in the username, and is hence beyond evil. Plus, of course, it doesn't match the RFC-specified possibilities and is hence uncompliant. -- Robert A. Uhl To be born British is to win first prize in the lottery of life. --Cecil Rhodes |