fleet/frontend/utilities/regex/regEx.ts

6 lines
146 B
TypeScript

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