I need to remove all special characters from string using Javascript but its unable to remove. Please find my code below.
function checkString(){
var sourceString='a|"bc!@£de^&$f g';
var outString = sourceString.replace(/[`~!@#$%^&*()|+\-=?;:'",<>\{\}\[\]\\\/]/gi, '');
console.log('sourcestring',outString);
}
Here I could not get the expected output. I am getting this abc£def g
in console. Here I need to remove all special characters. Please help me to resolve this issue.