From: James Edward Gray II Date: 2004-09-23T22:34:14+09:00 Subject: Re: Regexp#match(str, *offset*) On Sep 23, 2004, at 4:16 AM, trans. (T. Onoma) wrote: > Curious, where's the offset? I can do this with String#index: > > str.index(/re/,offset) > $~.begin > $~.end > > But not with Regexp itself? Regexps already include that ability natively. For example if you wanted to find the first space character after a 5 character offset, you could use: /^.{5,}? / Using Regexps to handle offsets can be significantly more flexible too. For example, here's a pattern to match the last space that occurs not more than 81 characters into the string (perhaps useful for wrapping): /^.{0,80} / Hope that helps. James Edward Gray II