makoto kuwata <k... / kuwata-lab.com> wrote:
> > str.index(/ba/, 5) ?
>
> No, String#index returns Fixnum (position), but I want MatchData.
>

I found that it is able to get MatchData by Regexp.last_match()
after String#index().
Well, I think Regexp#match(string, start=0) is the natural way,
but String#index(regexp, start) can be the good solution.

Thank you, Matz.

--
makoto kuwata