- isEmpty(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 neither consume characters nor assert characters.
If this function returns
true
, then isZeroLength and isPotentiallyEmpty are guaranteed to returntrue
.Backreferences
A backreferences will only be considered potentially empty, iff it is empty by the definition of isEmptyBackreference.
Relations
isEmpty(e) -> isZeroLength(e)
isEmpty(e) -> isPotentiallyEmpty(e)