Forum Moderators: coopster

Message Too Old, No Replies

Help with email regular expression

I have one, but is it any good?

         

twist

2:18 am on Apr 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Someone posted this on a message board and some people responded that it was good and others said it might have problems. So I thought I would come to the experts here and get a second opinion.

!eregi( "^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $email ) )

Any thoughts?

ironik

2:37 am on Apr 27, 2005 (gmt 0)

10+ Year Member



Looks fine, I'd probably change the 3 to a 6 though to allow for email@domain.museum addresses, although most of the domain qualifiers (I think that's what they call them) are either 2 or 3 letters (.com, .net, .co.uk).