Regular Expression For Email Validation

A regular expression that matches and validates email addresses.

/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/

Matches:

Non-matches:

  • admin#regexpattern.com
  • adminATregexpattern.com

Variants:

If you’re looking for a regular expression to match either empty string or email only, use this pattern instead:

/(^$|^.*@.*\..*$)/

See Also: