Function isPotentiallyEmpty

  • Returns whether at least one path of the given element does neither consume characters nor assert characters.

    Backreferences

    A backreferences will only be considered potentially empty, iff at least one of the following conditions is true:

    • The backreference is trivially always empty. (see isEmptyBackreference)
    • The referenced capturing group is a descendant of the given element and at least one of the following conditions is true:
      • The referenced capturing group is potentially zero-length.
      • The backreferences is not always after its referenced capturing group. (see isStrictBackreference)

    Relations

    • isPotentiallyEmpty(e) -> isPotentiallyZeroLength(e)

    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