regexp-helper.ts 123 B

12345
  1. export function escape(value: string): string {
  2. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  3. return `\\${x}`
  4. })
  5. }