From: Matt Armstrong Date: 2002-01-07T12:18:01+09:00 Subject: [ruby-talk:30414] Re: Efficient "lexing" in Ruby (maybe an RCR?) kjana@dm4lab.to (YANAGAWA Kazuhisa) writes: > Then you can use String#index(regexp, offset). Eg: nobu.nokada@softhome.net writes: > Or you can use String#index: Thanks to both of you. Good tip! Then my proposed Regexp.match_offset method is just this: class Regexp def match_offset(str, offset) str.index(self, offset) $~ end end -- matt