prolab-api/vendor/bower-asset/inputmask/lib/escapeRegex.js

4 lines
229 B
JavaScript
Raw Normal View History

2025-10-03 11:00:05 +00:00
const escapeRegexRegex = new RegExp("(\\" + ["/", ".", "*", "+", "?", "|", "(", ")", "[", "]", "{", "}", "\\", "$", "^"].join("|\\") + ")", "gim");
2025-09-24 06:24:52 +00:00
export default function (str) {
2025-10-03 11:00:05 +00:00
return str.replace(escapeRegexRegex, "\\$1");
}