mudge/re2

Matching against nil raises an error

Closed this issue · 0 comments

sk- commented

In plain ruby matching again nil does not raise an error

Regexp.new('a').match(nil)
 => nil

whereas in re2 does.

RE2::Regexp.new('a').match(nil)
TypeError: no implicit conversion of nil into String
    from (irb):2:in `match'
    from (irb):2
    from /Users/skreft/.rvm/rubies/ruby-2.2.1/bin/irb:11:in `<main>'