public abstract class LookAroundAssertion extends RegexASTSubtreeRootNode
See its two subclasses, LookAheadAssertion and LookBehindAssertion.
| Modifier and Type | Method and Description |
|---|---|
boolean |
endsWithCharClass() |
int |
getLiteralLength()
Returns the length of the words that can be matched by the body of this lookbehind assertion.
|
boolean |
isLiteral()
Checks if the contents of this assertion (
RegexASTSubtreeRootNode.getGroup()) are in "literal" form. |
boolean |
isNegated()
Indicates whether this is a negative lookaround assertion (written as
(?!...)
(?<!...)) or a positive one (written as (?=...) or (?<=)). |
boolean |
isSingleCCNonCapturingLiteral()
|
void |
setNegated(boolean negated) |
boolean |
startsWithCharClass() |
copy, getAnchoredFinalState, getAnchoredInitialState, getGroup, getMatchFound, getPrefix, getSubTreeId, getUnAnchoredInitialState, resetVisitorIterator, setAnchoredFinalState, setAnchoredInitialState, setGroup, setMatchFound, setSubTreeId, setUnAnchoredInitialState, subTreeIdInitialized, toJson, toString, visitorGetNext, visitorHasNextgetSeqIndex, getSubTreeParent, setSeqIndexasBackReference, asCharacterClass, asGroup, asLookAheadAssertion, asLookAroundAssertion, asLookBehindAssertion, asMatchFound, asPositionAssertion, asQuantifiableTerm, asSequence, astNodeId, endsWithDollar, equalsSemantic, getFlags, getId, getMaxPath, getMinPath, getParent, hasBackReferences, hasCaptureGroups, hasCaret, hasDollar, hasEmptyGuard, hasLookAheads, hasLookBehinds, hasLoops, hasQuantifiers, idInitialized, incMaxPath, incMaxPath, incMinPath, incMinPath, isBackReference, isCaret, isCharacterClass, isDead, isDollar, isExpandedQuantifier, isFlagSet, isGroup, isInLookAheadAssertion, isInLookBehindAssertion, isLookAheadAssertion, isLookAroundAssertion, isLookBehindAssertion, isMatchFound, isPositionAssertion, isPrefix, isQuantifiableTerm, isRoot, isSequence, isSubtreeRoot, markAsDead, setDead, setEmptyGuard, setEndsWithDollar, setEndsWithDollar, setExpandedQuantifier, setFlag, setFlag, setFlags, setHasBackReferences, setHasCaptureGroups, setHasCaret, setHasCaret, setHasDollar, setHasDollar, setHasLookAheads, setHasLookBehinds, setHasLoops, setHasLoops, setHasQuantifiers, setId, setMaxPath, setMinPath, setParent, setPrefix, setStartsWithCaret, setStartsWithCaret, startsWithCaret, toStringWithIDclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdtoJsonpublic boolean isNegated()
(?!...)
(?<!...)) or a positive one (written as (?=...) or (?<=)).
Positive lookaround assertions match if and only if the text around the current position matches the contents of the assertion. Negative lookaround assertions match if and only if the text around the current position does not match the contents of the assertion.
public void setNegated(boolean negated)
public boolean startsWithCharClass()
public boolean endsWithCharClass()
public boolean isLiteral()
RegexASTSubtreeRootNode.getGroup()) are in "literal" form.
This means that there is only a single alternative which is composed of a sequence of
CharacterClass nodes.public int getLiteralLength()
Because we restrict the regular expressions used in lookbehind assertions to "literal" regular expressions, all strings that match the body of the assertion are guaranteed to be of the same length. This is critical to how lookbehind is implemented, because it tells us how much do we have to rewind when matching a regular expression with lookbehind assertions.
public boolean isSingleCCNonCapturingLiteral()