I need a javascript function for validating alphabetic input with a few extra characters from the Italian languages, namely: àèéìòóù
I saw a regex before with something like:
[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]
What are those codes named and where can I find the right values?
I would like to use these into following function:
function val_alpha_it(str) {
var re = /[^A-Za-z]/
return re.test(str);
}
If the encoding works fine for your script, you can just put the characters in the negative set in the regular epxression:
If you need to specify the characters using character codes, those are unicode code points. You can look them up in the Unicode character set. The character à for example has character code
00E0, so you write that as\u00E0. So, with character code escapes, the code would be: