Class: PEG::Regex

Inherits:
Literal show all
Defined in:
lib/peg.rb

Instance Attribute Summary

Attributes inherited from Rule

#children

Instance Method Summary collapse

Methods inherited from Literal

#_inspect, #initialize

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