Class AtomicGroup

All Implemented Interfaces:
AbstractState<Term,ASTTransition>, RegexASTVisitorIterable, JsonConvertible

public final class AtomicGroup extends RegexASTSubtreeRootNode
A group that commits to its first successful match. Backtracking will not consider any other match for the contents of the group.

Used in Ruby regular expressions.

  • Method Details

    • copy

      public RegexASTSubtreeRootNode copy(RegexAST ast)
      Description copied from class: RegexASTNode
      Copy this node only, without any child nodes. The ID and minPath of the copied nodes is left unset.
      Specified by:
      copy in class RegexASTSubtreeRootNode
      Parameters:
      ast - RegexAST the node should belong to.
      Returns:
      A shallow copy of this node.
    • copyRecursive

      public Term copyRecursive(RegexAST ast, CompilationBuffer compilationBuffer)
      Description copied from class: RegexASTNode
      Recursively copy this subtree. This method should be used instead of CopyVisitor if the copying process is required to be thread-safe. The ID and minPath of the copied nodes is left unset.
      Specified by:
      copyRecursive in class Term
      Parameters:
      ast - RegexAST the new nodes should belong to.
      Returns:
      A deep copy of this node.
    • getEnclosedCaptureGroupsLow

      public int getEnclosedCaptureGroupsLow()
      Gets the (inclusive) lower bound of the range of capture groups contained within this group.
    • getEnclosedCaptureGroupsHigh

      public int getEnclosedCaptureGroupsHigh()
      Gets the (exclusive) upper bound of the range of capture groups contained within this group.
    • getPrefix

      public String getPrefix()
      Specified by:
      getPrefix in class RegexASTSubtreeRootNode
    • equalsSemantic

      public boolean equalsSemantic(RegexASTNode obj)
      Specified by:
      equalsSemantic in class RegexASTNode
    • toJson

      public JsonValue toJson()