Regex-expression with danish characters
Posted
by timkl
on Stack Overflow
See other posts from Stack Overflow
or by timkl
Published on 2010-03-16T11:40:49Z
Indexed on
2010/03/16
11:46 UTC
Read the original article
Hit count: 344
I'm currently trying to wrap my head around regex, I have a validation snippet that tests an input box against a regex-expression:
$.validator.addMethod("customerName", function(value, element){
return (/^[a-zA-Z]*$/).test(value);
}, "Some text");
That works well, but when I try to add a space and some special danish characters, it doesn't filter the danish characters, only the space.
$.validator.addMethod("customerName", function(value, element){
return (/^[a-zA-Z æøåÆØÅ]*$/).test(value);
}, "Some text");
Any ideas to what could be wrong?
© Stack Overflow or respective owner