Page 1 of 1

Multilanguage

Posted: Tue Sep 13, 2005 11:43 am
by Ree
How do you solve multilanguage problem when using regex? For example name validation pattern

Code: Select all

$pattern = '#^[a-ząčęėįšųūž]+$#i';
simply won't work: if it's a-z what's entered, it works. If it contains any of the language specific characters (čęėįšųūž), it doesn't. Does that mean I will not be able to write a proper regex to validate my language names? Is there a solution?

EDIT: it seems the chars got converted to &#stuff;. :roll:

Posted: Tue Sep 13, 2005 5:37 pm
by timvw
I believe there is a 'u' modifier that enables unicode characters in the re (http://be.php.net/manual/en/reference.p ... ifiers.php)

Posted: Wed Sep 14, 2005 2:49 am
by Ree
Thanks timvw, that did the trick. :)