Function regexFixFlags

  • Takes a string of RegExp flags and returns a string guaranteed to be valid.

    Parameters

    • flags: string

      string of RegExp flags

    Returns string

    The processed string of regex flags.

    Remarks

    This function does not validate if the input string is a valid regex flags string. It only removes duplicates and non-regex characters.

    Throws

    This function does not throw any exceptions.

    See

    strSortChars, strRemoveDuplicateChars

    Example

    regexFixFlags('ggim') // 'gim'
    regexFixFlags('?gim*') // 'gim'

Generated using TypeDoc