Page 1 of 1

"Foreign" languages characters in e-mail addresses

Posted: 2010-08-09 17:15
by Tom
I'm currently working on a German website and have ran into a problem with validating e-mail addresses. Apparently letters like ö ä ü are allowed in German e-mail addresses, but MX Form Validation doesn't.
Any ideas?

Cheers,
Tom

Re: "Foreign" languages characters in e-mail addresses

Posted: 2010-08-09 20:55
by Fred
You will have to validate using a regular expression.

This is not only a MX Validation issue, everyone is sitting with the same issues. Even those that uses regex to validate. it is going to become even more of an issue now that you can register domains in the native character-set. Chinese and Russian for example.

Look at this site here for some pointers: http://www.noupe.com/php/php-regular-expressions.html

Maybe something like...
([a-zA-Z0-9\W^@])+([a-zA-Z0-9\._-\W^@])*@([a-zA-Z0-9_-\W^@])+([a-zA-Z0-9\._-\W^@]).([a-zA-Z\W^@])

Where \W matched any non-alphanumeric character.
and the ^@ check for "@" not-in the specific part of the address. (Might not work)

Note: I did not check the expression for validity.

Please post your solution when you are done.

Re: "Foreign" languages characters in e-mail addresses

Posted: 2010-08-10 21:04
by Tom
Thanks, Fred !
I'll do some experimentation and post any solution I come up with.
Great to be able to ask questions and actually get answers - like in the good old days with InterAkt...

Tom