Search code examples
javascriptregexblacklist

javascript regex: blacklist 5 chars


I want to blacklist the following chars:

' ( = < >

So every char is allowed but not the 5 listed above.

How do I replace them with regex?

 myString.replace(regexString, '');

Solution

  • myString.replace(/['(=<>]/g, '');