Javascript regex for validating name without accented characters -


i'm using simple javascript regular expression validate people's names. however, not want allow user enter accented characters ã, ä, õ, ö, etc. aware these can valid characters in name, exercise, need able filter them out.

my current regex:

^[a-za-z]+('|-|.|)[a-za-z\s]+$ 

this matches accented characters well. how modify regex doesn't match names accents (or unicode character, matter)?

remove ., because . match character. cause matching accented character.

^[a-za-z]+('|-)[a-za-z\s]+$ 

or escape . if mean literal dot.

^[a-za-z]+('|-|\.)[a-za-z\s]+$ 

Comments

Popular posts from this blog

matlab - Deleting rows with specific rules -

jquery - How would i go about shortening this code? And to cancel the previous click on click of new section? -