• Returns a regex that compiled by the given pattern

    Parameters

    • Optionalpattern: string

      the pattern to inspect

    • Optionalflags: string

      any combination of flag values

    Returns RegExp | undefined

    a regex that compiled by the given pattern

    compilePattern('[a-zA-Z0-9]+', 'g');