public final class ConditionalBackReferenceGroup extends Group
(?(group_name)then_branch|else_branch
Every conditional back-reference group has exactly 2 alternatives. The first alternative can only be taken if the referenced group was matched and the second alternative can be taken only if the referenced group was *not* matched.
| Constructor and Description |
|---|
ConditionalBackReferenceGroup(int referencedGroupNumber)
Creates an empty conditional back-reference group.
|
| Modifier and Type | Method and Description |
|---|---|
ConditionalBackReferenceGroup |
copy(RegexAST ast)
Copy this node only, without any child nodes.
|
ConditionalBackReferenceGroup |
copyRecursive(RegexAST ast,
CompilationBuffer compilationBuffer)
Recursively copy this subtree.
|
boolean |
equalsSemantic(RegexASTNode obj,
boolean ignoreQuantifier) |
int |
getReferencedGroupNumber()
Returns the index of the capture group that is referenced by this conditional expression.
|
JsonValue |
toJson() |
String |
toString() |
add, addSequence, alternativesToString, clearGroupNumber, getAlternatives, getBoundaryIndexEnd, getBoundaryIndexStart, getEnclosedCaptureGroupsHigh, getEnclosedCaptureGroupsLow, getFirstAlternative, getGroupNumber, getLastAlternative, groupNumberToBoundaryIndexEnd, groupNumberToBoundaryIndexStart, hasEnclosedCaptureGroups, insertFirst, isAlwaysZeroWidth, isCapturing, isEmpty, isLiteral, isLocalFlags, isLoop, isUnrollingCandidate, loopToString, removeLastSequence, resetVisitorIterator, setAlternatives, setEnclosedCaptureGroupsHigh, setEnclosedCaptureGroupsLow, setGroupNumber, setLocalFlags, setLoop, size, visitorGetNext, visitorHasNextequalsSemantic, getQuantifier, getSubTreeParent, hasNotUnrolledQuantifier, hasQuantifier, quantifierToString, setQuantifiergetSeqIndex, setSeqIndexasAtomicGroup, asBackReference, asCharacterClass, asConditionalBackReferenceGroup, asGroup, asLookAheadAssertion, asLookAroundAssertion, asLookBehindAssertion, asMatchFound, asPositionAssertion, asQuantifiableTerm, asSequence, asSubtreeRootNode, astNodeId, endsWithDollar, getFlags, getId, getMaxPath, getMinPath, getParent, getPrefixLengthMax, getPrefixLengthMin, hasBackReferences, hasCaptureGroups, hasCaret, hasDollar, hasEmptyGuard, hasLookAheads, hasLookBehinds, hasLoops, hasQuantifiers, hasVariablePrefixLength, idInitialized, incMaxPath, incMaxPath, incMinPath, incMinPath, isAtomicGroup, isBackReference, isCaret, isCharacterClass, isConditionalBackReferenceGroup, 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, setPrefixLengthMax, setPrefixLengthMin, setStartsWithCaret, setStartsWithCaret, startsWithCaret, toJson, toStringWithIDclone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitgetIdpublic ConditionalBackReferenceGroup(int referencedGroupNumber)
Sequences as its alternatives.referencedGroupNumber - The number of the capture group referenced in the condition.public int getReferencedGroupNumber()
public ConditionalBackReferenceGroup copy(RegexAST ast)
RegexASTNodepublic ConditionalBackReferenceGroup copyRecursive(RegexAST ast, CompilationBuffer compilationBuffer)
RegexASTNodeCopyVisitor if
the copying process is required to be thread-safe. The ID and minPath of the copied nodes is
left unset.copyRecursive in class Groupast - RegexAST the new nodes should belong to.public boolean equalsSemantic(RegexASTNode obj, boolean ignoreQuantifier)
equalsSemantic in class Grouppublic JsonValue toJson()
toJson in interface JsonConvertibletoJson in class Group