HEEEELP ME!
I can't make javascript to validate username form field with unicode characters (charset=utf-8).
PHP that works well on server side:
$legalChars = "/\p{L}|\p{Pc}|\p{N}/"; // allow letters, numbers and underscores
$legalCharsCount = preg_match_all($legalChars,$strng,$blb);
...
JavaScript that drives me crasy:
var error = "";
var illegalChars = /\p{L} \p{Nd}/; //I tried also: / :Lu | :N / and similar expressions without result.
if (illegalChars.test(strng)) { //tried also .match and .seach combinations
error = "The username contains illegal characters.\n";
}
Is ther anyone out-there to know what it is all about ??
Many thanks in advance.