6 lines
130 B
JavaScript
Raw Normal View History

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