Class: Regexp
- Includes:
- Cannonbol::Operators
- Defined in:
- lib/cannonbol/cannonbol.rb
Instance Method Summary collapse
Methods included from Cannonbol::Operators
#&, #_match?, #capture!, #capture?, included, #insensitive, #matches?, #|
Instance Method Details
#__match?(needle, thread_state = nil) ⇒ Boolean
576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 |
# File 'lib/cannonbol/cannonbol.rb', line 576 def __match?(needle, thread_state = nil) if RUBY_ENGINE == 'opal' = "" += "m" if `#{self}.multiline` += "g" if `#{self}.global` += "i" if needle.ignore_case or `#{self}.ignoreCase` else = self. | (needle.ignore_case ? Regexp::IGNORECASE : 0) end @cannonbol_regex ||= Regexp.new("^#{self.source}", ) if thread_state needle.pull(thread_state) elsif m = @cannonbol_regex.match(needle.remaining_string) [needle.push(m[0].length)] end end |