mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
8 lines
220 B
TypeScript
8 lines
220 B
TypeScript
const ESCAPE_RULE = /[$()*+.?[\\\]^{|}]/g;
|
|
const DASH_RULE = /-/g;
|
|
|
|
export const escapeRegexString = (subject: string): string => {
|
|
return subject
|
|
.replace(ESCAPE_RULE, '\\$&')
|
|
.replace(DASH_RULE, '\\x2d');
|
|
};
|