https://developer.mozilla.org/ja/docs/Web/JavaScript/Guide/Regular_Expressions#escaping 以下の関数を定義して使う。 ```ts function escapeRegExp(str: string): string { return str.replace(/[.*+?^=!:${}()|[\]\/\\]/g, '\\amp;'); } ``` [[Results of TC39 presentation #37]]で拒否されたため標準実装はされていない。