fleet/frontend/utilities/regex/regEx.ts

6 lines
146 B
TypeScript
Raw Normal View History

export const escapeRegEx = (text: string): string => {
return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
export default escapeRegEx;