6 lines
130 B
JavaScript

const escapeRegExp = string => {
return string.replace(/[-/\\^$*+?.()|[\]{}]/g, '\\$&');
};
module.exports = { escapeRegExp };