IFClite TypeScript API
    Preparing search index...

    Function compileGuardedRegex

    • Guarded new RegExp(...): validates pattern with assertGuardedRegexPattern (throwing UnsafeRegexPatternError on rejection) and only then compiles it with the JS RegExp constructor, which itself may throw SyntaxError for a malformed pattern the guard did not reject.

      Parameters

      • pattern: string
      • Optionalflags: string
      • Optionalopts: { maxLength?: number }

      Returns RegExp