Method: StrScanParserR#match

Defined in:
lib/web/strscanparser.rb

#match(regex, &block) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/web/strscanparser.rb', line 6

def match regex, &block
  if s = @scanner.scan(regex)
   #   $stderr.puts "got: #{s}"
 yield @scanner if block
 s
  else
    #  $stderr.puts "tried #{regex.source} on: #{@scanner.rest}"
 nil
  end
end