class Regex::NonCapturingGroup

A non-capturing group, in other word it is a pure grouping of sub-expressions

Public Class Methods

new(aChild) click to toggle source

Constructor.

aChild

A sub-expression to match. When successful

the matching text is assigned to the capture variable.

Calls superclass method Regex::MonadicExpression::new
# File lib/regex/non_capturing_group.rb, line 14
def initialize(aChild)
  # If necessary get rid of nested non-capturing groups
  effective_child = aChild.kind_of?(self.class) ? aChild.child : aChild
  super(effective_child)
end

Protected Instance Methods

text_repr() click to toggle source

Conversion method re-definition. Purpose: Return the String representation of the captured expression.

# File lib/regex/non_capturing_group.rb, line 24
def text_repr
  result = "(?:#{all_child_text})"
  return result
end