Function isZeroLength

  • Returns whether all (but at least one of the) paths of the given element do not consume characters.

    If this function returns true, then isPotentiallyZeroLength is guaranteed to return true.

    Backreferences

    This function uses the same condition for backreferences as isEmpty.

    Relations

    • isZeroLength(e) -> isPotentiallyZeroLength(e)
    • isZeroLength(e) -> getLengthRange(e).max == 0

    Parameters

    • element: Alternative | CapturingGroup | ClassRangesCharacterClass | UnicodeSetsCharacterClass | CharacterClassRange | ClassIntersection | ClassStringDisjunction | ClassSubtraction | ExpressionCharacterClass | Group | LookaheadAssertion | LookbehindAssertion | Quantifier | StringAlternative | Backreference | EdgeAssertion | WordBoundaryAssertion | Character | AnyCharacterSet | EscapeCharacterSet | CharacterUnicodePropertyCharacterSet | StringsUnicodePropertyCharacterSet | readonly Alternative[]
    • flags: ReadonlyFlags

    Returns boolean