Class: Regexp::Expression::Conditional::Condition
- Defined in:
- lib/regexp_parser/expression/classes/conditional.rb
Instance Attribute Summary
Attributes inherited from Base
#conditional_level, #level, #nesting_level, #options, #quantifier, #set_level, #text, #token, #ts, #type
Instance Method Summary collapse
-
#reference ⇒ Object
Name or number of the referenced capturing group that determines state.
Methods inherited from Base
#ascii_classes?, #attributes, #case_insensitive?, #coded_offset, #default_classes?, #free_spacing?, #full_length, #greedy?, #initialize, #initialize_clone, #is?, #match, #matches?, #multiline?, #offset, #one_of?, #possessive?, #quantified?, #quantifier_affix, #quantify, #quantity, #reluctant?, #strfregexp, #terminal?, #to_re, #to_s, #type?, #unicode_classes?
Constructor Details
This class inherits a constructor from Regexp::Expression::Base
Instance Method Details
#reference ⇒ Object
Name or number of the referenced capturing group that determines state. Returns a String if reference is by name, Integer if by number.
12 13 14 15 |
# File 'lib/regexp_parser/expression/classes/conditional.rb', line 12 def reference ref = text.tr("'<>()", "") ref =~ /\D/ ? ref : Integer(ref) end |