def match_regexp(reg)
      ret = nil
      if matched = reg.match(@input[@current_pos])
        ret = matched.to_s
        @current_pos += ret.size
      else
        ret = :failed
        fail(type: "class", value: reg.inspect, description: reg.inspect) if @silent_fails == 0
      end
      ret
    end
def match_regexp(reg)
      ret = nil
      if matched = reg.match(@input[@current_pos])
        ret = matched.to_s
        @current_pos += ret.size
      else
        ret = :failed
        fail(type: "class", value: reg.inspect, description: reg.inspect) if @silent_fails == 0
      end
      ret
    end
match regexp