- isZeroLength(element, flags): boolean
-
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[]
-
Returns boolean
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 returntrue
.Backreferences
This function uses the same condition for backreferences as isEmpty.
Relations
isZeroLength(e) -> isPotentiallyZeroLength(e)
isZeroLength(e) -> getLengthRange(e).max == 0