This is a discussion on "Unicode Regular Expression won't work ??" within the JavaScript Forum section. This forum, and the thread "Unicode Regular Expression won't work ?? are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
Unicode Regular Expression won't work ??
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
Unicode Regular Expression won't work ??
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. |
|
|
![]() |
| Tags |
| form, regular expression, unicode, validation |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| MS Expression | radiated | Scripts and Online Services | 11 | Aug 7th, 2007 01:16 |
| Extract attribute value with Regular Expression? | ScottDC | PHP Forum | 2 | May 18th, 2007 08:37 |
| Help spliting string by regular expression | Sagaris | PHP Forum | 8 | May 1st, 2007 20:46 |
| regular expressions to parse | anand1107 | JavaScript Forum | 1 | Mar 21st, 2007 11:32 |
| Need Custom Designer For Regular Work! | BlueField | Job Opportunities | 0 | Jun 30th, 2006 23:45 |