In the project that i am working on i want to add enhancement feature where user can add their French name in the first name field.
I want to include all the special characters for French
Right now in the current code, when I am trying to add French characters in the First name, an error is getting thrown.
Please find below JS code validation for First Name. Which exists in the code right now.
var firstNameRegex = /^[a-zA-Z\u3000\u3400-\u4DBF\u4E00-\u9FFF\-\'\s]{1,45}$/;
I tried for 5 special characters like this
var firstNameRegex = /^[a-zA-Z\.\u3000\u3400-\u4DBF\u4E00-\u9FFF\u0105\u0107\u0119\u0142\u0144\u00f3\u015b\u017a\u017c\-\'\s]{1,45}$/;
But to include all the characters unicode separately seems bit lengthy Does anyone has any idea how to include all the French Characters with an simpler code.
I tried this combination
var firstNameRegex = /^[a-zA-Z\u3000\u3400-\u4DBF\u4E00-\u9FFF\u00C0-\u017F\-\'\s]{1,45}$/;
But this is not working

you can modify regex-
hope this workd