JSFiddle - React, Tailwind, and code Playground

Remove special characters

by tonytlwu

HTML

<pre id="debug"></pre>

JavaScript

var str = 'o\'"‘“”’brien日 本 語äي هو السي another word ';
var pattern = /[&\/\\#,+()$~%.'‘’"“”:*?<>{}]+/g;
document.querySelector('#debug').innerHTML = str.replace(pattern, '');