• Builds a partial regex from the input regex. A partial regex is able to match incomplete input strings. E.g. a partial regex constructed from /ab/ is able to match the string a without needing a following b character. However it won't match b alone.

    Parameters

    • regex: string | RegExp

      The input regex to be converted.

    Returns RegExp

    A partial regex constructed from the input regex.