I have a string with the value Québec and I want not to match é word from giving regex.
In a given regex é word it getting matched I want to escape from this word and it should go inside the else loop.
the output should "be it is not matched"
how it should be done?
if I have banned word regex that is const regex = new RegExp("^[^é]*$")
how can I add inside the const regex = new RegExp("[^\u0021-\u007A \u014D ]","\gm")
I want to join these 2 regex in order to have one for checking the special character
const regex = new RegExp("[^\u0021-\u007A \u014D ]","\gm")
var str ="Québec"
console.log(regex,str);
if (regex.test(str)){
console.log("it is matched");
}else{
console.log("it is not matched")
}