Closed sk- closed 9 years ago
In retrospect, I think the multiple return types of RE2::Regexp#match
are a mistake: it should just consistently return RE2::MatchData
objects (even if they contain no captured groups) or nil
.
Unfortunately, this would be a breaking API change but we could use a major new version to rethink the API. I'm not sure whether we should be more like Ruby's API or try to match the underlying re2 C++ interface.
In plain ruby we have:
whereas in
re2
: