Vanilla JS function escapeRegex(string) { return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); } // Or with npm: npm install escape-string-regexp const ...
確定! 回上一頁