I want to use a regular expression which will allow
- English text which does not have a special character.
- French Text which does not have a special character.
It will always disallow special characters like @, #, % etc... in both the language.
I have tried with the below code:
if (this.value.match(/[^a-zA-Z0-9 ]/g)) {
this.value = this.value.replace(/[^a-zA-Z0-9 ]/g, '');
}
It works fine with english text, but the problem is when I provide a french text like éléphant, it considers the french characters as special character, and deletes the french characters. so éléphant becomes lphant.
Is there any way to allow the french characters inside the regular expression?
Thanks a lot in advance.