1

I am working on FormCheck http://mootools.floor.ch/docs/formcheck/files/formcheck-js.html and just fund out that it has issues with other characters except a-z for example :филми
you can try it on their demo under alpha http://mootools.floor.ch/en/demos/formcheck/

now I am making a multilingual form that works fine but my verification fails when somone starts typing with special chars.

long story short , this is

alpha regex

alpha: /^[a-z ._-]+$/i

how can I modify it to include any alpha chars?

Benn
  • 4,840
  • 8
  • 65
  • 106
  • possible duplicate of [Test if string contains only letters (a-z + é ü ö ê å ø etc..)](http://stackoverflow.com/questions/2013451/test-if-string-contains-only-letters-a-z-e-u-o-e-a-o-etc) – Ben Lee Feb 21 '12 at 02:19

1 Answers1

2

Try using the XRegExp Unicode plugin. With that library you could do something like this:

var unicodeWord = XRegExp("^\\p{L}+$");
// \p{L} matches any "letter" codepoint.
unicodeWord.test('филми'); // true
unicodeWord.test('movies'); // true
unicodeWord.test('!@#$'); // false
maerics
  • 151,642
  • 46
  • 269
  • 291