Log in

View Full Version : ia any wrong above[validating email address Reqexp] ?



leonidassavvides
11-09-2008, 02:34 PM
(eregi("^[a-z0-9]+([-_\.]?[a-z0-9])+@[a-z0-9]+([-_\.]?[a-z0-9])+\.[a-z\.]{2,4}", $email))

ia any wrong above[validating email address Reqexp] ? the "_" may exist right-hand side of "@" ?

addresses like
a080725@cytanet.com.cy
a080725@cytanet.depart.com.cy
get true - passed ?

clueful
11-09-2008, 07:05 PM
This regex is expressed as a string, presumably to be passed to a RegEx constructor, so the backslashes have to be escaped: \\

jscheuer1
11-09-2008, 09:44 PM
This regex is expressed as a string, presumably to be passed to a RegEx constructor, so the backslashes have to be escaped: \\

Trick question (though you may still be correct, PHP isn't my strong point), eregi is one of the PHP regular expression constructors. This question probably belongs in the PHP forum, I'm moving it. If there are any valid objections, I will return it to the javascript forum.