私は正規表現に悩まされています。これらの恐ろしいコードになると、私は失読症だと思います..とにかく、これを行うための簡単な方法が必要です。(つまり、 1行)、誰ですか?前もって感謝します。複数の正規表現を置き換えます
function clean(string) {
string = string.replace(/\@[email protected]/g, '').replace(/}/g, '@[email protected]');
string = string.replace(/\@[email protected]/g, '').replace(/{/g, '@[email protected]');
string = string.replace(/\@[email protected]/g, '').replace(/\"/g, '@[email protected]');
string = string.replace(/\@[email protected]/g, '').replace(/\:/g, '@[email protected]');
string = string.replace(/\@[email protected]/g, '').replace(/\,/g, '@[email protected]');
return string;
}
サンプルを入力してください。 – Shekhar
実際に何をしようとしていますか? – Gumbo