mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-03 17:59:55 +02:00
4 lines
No EOL
229 B
JavaScript
4 lines
No EOL
229 B
JavaScript
const escapeRegexRegex = new RegExp("(\\" + ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^"].join("|\\") + ")", "gim");
|
|
export default function (str) {
|
|
return str.replace(escapeRegexRegex, "\\$1");
|
|
} |