Class: PEG::Regex
- Inherits:
-
Literal
- Object
- ValueObject
- Rule
- Literal
- PEG::Regex
- Defined in:
- lib/peg.rb
Instance Attribute Summary
Attributes inherited from Rule
Instance Method Summary collapse
Methods inherited from Literal
Methods inherited from Rule
#initialize, #inspect, #name, #parse, #result
Methods inherited from ValueObject
Constructor Details
This class inherits a constructor from PEG::Literal
Instance Method Details
#match(text) ⇒ Object
71 72 73 74 |
# File 'lib/peg.rb', line 71 def match(text) res = Regexp.new('\A' + @literal).match(text) res && result(res.to_s) end |