Bob wrote: >Suggested change (incorporating everything above): > > if( eregi( "[EMAIL PROTECTED]([- >.]?[0-9a-z])*\\.[a-z]{2,6}$", $email, $check ))
While playing around with this, I noticed that it does not accept [EMAIL PROTECTED] as a valid email address, while the old/current regexp does accept it (again, probably due to the unescaped dot). >I've tested this and it works, correctly accepting >[EMAIL PROTECTED] and [EMAIL PROTECTED] and >correctly rejecting [EMAIL PROTECTED] and >[EMAIL PROTECTED] I'm not sure about the last case but >I've never seen an address of this form before; In my understanding of RFC(2)822, that last example would be valid, too. PEAR's Mail_RFC822 class accepts [EMAIL PROTECTED], but does not accept [EMAIL PROTECTED] :-/ >I know, someone could easily spend a month trying to make COM_isemail >identify all legal email addresses Yeah, it's a pretty complex matter. I don't care about the case with more than one '+' too much, but I think that domains without a dot should be accepted. My regexp-fu is a bit rusty, what would the correct expression be? My first idea was ...(\\.[a- z]{2,6}){0,1}$ but that accepts things like @blah.localhost ... bye, Dirk -- http://www.haun-online.de/ http://geeklog.info/