Javascript – Best practices for email address validation (including the + in gmail addresses)


I know there are a lot of questions on here about email validation and specific RegEx's. I'd like to know what the best practices are for validating emails with respect to having the trick (details here). My current RegExp for JavaScript validation is as follows, but it doesn't support the extra + in the handle:


Are there any other services that support the extra +? Should I allow a + in the address or should I alter the RegEx to only allow it for an email with or as the domain? If so, what would be the altered RegEx?

Thanks to everyone for pointing out that + is valid per the spec. I didn't know that and now do for the future. For those of you saying that its bad to even use a RegEx to validate it, my reason is completely based on a creative design I'm building to. Our client's design places a green check or a red X next to the email address input on blur of it. That icon indicates whether or not its a valid email address so I must use some JS to validate it then.

Best Solution

+ is a valid character in an email address. It doesn't matter if the domain isn't or

Regexes aren't actually a very good way of validating emails, but if you just want to modify your regex to handle the plus, change it to the following:


As an example of how this regex doesn't validate against the spec: The email is valid according to it.