You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Today I had occasion to try to replace a usage of the Ruby Regexp class like:
"foo".scan(/(.)/){|match| ... }
with an RE2 regular expression.
I quickly ran up against the fact that RE2::Scanner#scan returns Array<String> rather than Array<RE2::MatchData>.
In my case, I want access to the begin and end metadata that the RE2::MatchData would carry.
Is this something you'd accept a PR for?
It's possible I'll be able to use ReplaceAll instead, in this particular case, or work around it another way, so I can't guarantee I'll put one together, but I wanted to assess the likelihood of it being accepted early :)
The text was updated successfully, but these errors were encountered:
I’d be happy to review a PR for that but we’d need to introduce a new API for it to avoid breaking compatibility. Perhaps another method on Scanner or a separate class altogether?
Hi,
Today I had occasion to try to replace a usage of the Ruby
Regexp
class like:with an RE2 regular expression.
I quickly ran up against the fact that
RE2::Scanner#scan
returnsArray<String>
rather thanArray<RE2::MatchData>
.In my case, I want access to the
begin
andend
metadata that theRE2::MatchData
would carry.Is this something you'd accept a PR for?
It's possible I'll be able to use
ReplaceAll
instead, in this particular case, or work around it another way, so I can't guarantee I'll put one together, but I wanted to assess the likelihood of it being accepted early :)The text was updated successfully, but these errors were encountered: