Skip to content Skip to sidebar Skip to footer

Javascript Regex To Check Email Format Like Facebook Registration Form

I currently use this pattern for checking email format: /^(('[\w-+\s]+')|([\w-+]+(?:\.[\w-+]+)*)|('[\w-+\s]+')([\w-+]+(?:\.[\w-+]+)*))(@((?:[\w-+]+\.)*\w[\w-+]{0,66})\.([a-z]{2,6}(

Solution 1:

Facebook signup page has a script that defines function is_email as:

functionis_email(a){return/^([\w!.%+\-])+@([\w\-])+(?:\.[\w\-]+)+$/.test(a);}

Not quite RFC822: http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html

Post a Comment for "Javascript Regex To Check Email Format Like Facebook Registration Form"