Email Problem


Hi there,

We have a user who has a ‘+’ character in their email address, eg. "". How do i get it right to make the email address valid coz everytime it says ‘invalid email address’. Do i have to add the ‘+’ character somewhere?

This is the code we use:

var patn = /^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-])@[a-zA-Z0-9-]+([.][a-zA-Z0-9-]+)+$/;

Thanks in advance :)


According to RFC 2822, the local-part of the address may use any of these ASCII characters:
* Uppercase and lowercase letters (case sensitive)
* The digits 0 through 9
* The characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
* The character . provided that it is not the first or last character in the local-part.</blockquote>

At first I thought such characters weren’t allowed at all in an email address (mainly because they’re not allowed in URLs either), so I decided to look that up.

As for your pattern, I’d say you’d need to change it as such:

var patn = “/^[_a-zA-Z0-9-]+(.[_a-zA-Z0-9-+])@[a-zA-Z0-9-]+([.][a-zA-Z0-9-]+)+$/”;

See the bold backslash and the + sign behind it.


Thanks alot hey,
Its all working now, thanks for your great assistance. :lol:


Just trying to add my $.02 :slight_smile: