mirror of
https://github.com/Unleash/unleash.git
synced 2024-11-01 19:07:38 +01:00
4 lines
150 B
TypeScript
4 lines
150 B
TypeScript
|
export function safeRegExp(pattern: string, flags?: string): RegExp {
|
||
|
return new RegExp(pattern.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'), flags);
|
||
|
}
|