mudge / re2

Ruby bindings to RE2, a "fast, safe, thread-friendly alternative to backtracking regular expression engines like those used in PCRE, Perl, and Python".
http://mudge.name/re2/
BSD 3-Clause "New" or "Revised" License
129 stars 13 forks source link

Matching against nil raises an error #28

Closed sk- closed 9 years ago

sk- commented 9 years ago

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>'