I want to add functionality for user to add First name or Last name in any language for Eg. Spanish, French and Chinese. Right now I am using this RegEx:
var firstNameRegex = /^[a-zA-Z\u3000\u3400-\u4DBF\u4E00-\u9FFF\u00C0-\u017F\-\'\s]{1,45}$/;
But this is only working for English Alphabets When I am trying to add French characters like
à- â - ä- é - è - ê - ë - ï - î - ô -ö - ù - û - ü- ÿ-ç
Then i am getting error.
Any suggestions.
Use this regex:
Or this if only whitespaces are not valid:
please see this regex cheatsheet