Re: Regex æøå email validation?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Søren Neigaard wrote:

> Hi guys
> 
> Im helping a friend with hes internet site, and I have found this
> regex email validation regex on the internet:
> 
> var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-
> z]{2,6}(?:\.[a-z]{2})?)$/i;
> if(!filter.test(email)) {
> return false;
> }
> 
> It works fine, but my friend strangely enough has users with special
> danish letters (æøåÆØÅ) in their email address, and that it does not
> accept. Regex is black magic to me, I have tried to modify it in
> different ways, but with no luck.
> 
> I know its not PHP specific (its JavaScript), but maybe one of you
> can help me anyways?

Hej Søren

to get it to work, you need to be in the Danish locale, otherwise "æøå"
won't be recognised as being word-characters. In javascript, I'm not
sure, but maybe you have to use UTF-8?


/Per Jessen, Zürich

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux