Class: MemDB::RegexpEngines::Std
- Inherits:
-
Object
- Object
- MemDB::RegexpEngines::Std
- Defined in:
- lib/mem_db/regexp_engines/std.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(source, ignore_case: false) ⇒ Std
constructor
A new instance of Std.
- #match?(str) ⇒ Boolean
Constructor Details
#initialize(source, ignore_case: false) ⇒ Std
Returns a new instance of Std.
10 11 12 13 14 15 |
# File 'lib/mem_db/regexp_engines/std.rb', line 10 def initialize(source, ignore_case: false) opts = ::Regexp::MULTILINE opts |= ::Regexp::IGNORECASE if ignore_case @rx = ::Regexp.new(source, opts) end |
Class Method Details
.quote(str) ⇒ Object
6 7 8 |
# File 'lib/mem_db/regexp_engines/std.rb', line 6 def self.quote(str) ::Regexp.quote(str) end |
Instance Method Details
#match?(str) ⇒ Boolean
17 18 19 |
# File 'lib/mem_db/regexp_engines/std.rb', line 17 def match?(str) @rx.match?(str) end |