I need the regular expression to accept the ç key.
$('[name="txtEndereco"]').keyup(function () { this.value = this.value.replace(/[^a-zA-Z 0-9]+/g,''); });
I need the regular expression to accept the ç key.
$('[name="txtEndereco"]').keyup(function () { this.value = this.value.replace(/[^a-zA-Z 0-9]+/g,''); });
/[^a-zA-ZçÇ 0-9]+/g
Working with regex in letters with accents is +/- difficult in JavaScript.
In other languages there is class \p{L}
which includes all characters that are letters. In JavaScript sometimes it is best to add cases that are accurate.
Using [À-ú] takes cedilla, uncle, grave accent, acute accent, caret accent, etc. I had problems and I used this expression, it worked very well.