Class: Regex::NonCapturingGroup
- Inherits:
-
MonadicExpression
- Object
- Expression
- CompoundExpression
- MonadicExpression
- Regex::NonCapturingGroup
- Defined in:
- lib/regex/non_capturing_group.rb
Overview
A non-capturing group, in other word it is a pure grouping of sub-expressions
Instance Attribute Summary
Attributes inherited from MonadicExpression
Attributes inherited from Expression
Instance Method Summary collapse
-
#initialize(aChild) ⇒ NonCapturingGroup
constructor
Constructor.
Methods inherited from MonadicExpression
Methods inherited from CompoundExpression
Methods inherited from Expression
Constructor Details
#initialize(aChild) ⇒ NonCapturingGroup
Constructor. [aChild] A sub-expression to match. When successful the matching text is assigned to the capture variable.
12 13 14 15 16 |
# File 'lib/regex/non_capturing_group.rb', line 12 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 |