From: Brian Candler Date: 2009-12-15T00:49:29+09:00 Subject: Re: Ruby 1.9 string slicing and StringScanner pointers Robert Klemme wrote: > I don't know StringScanner internals, but does this have to be so? I > mean, with $' you get the remainder of the string so when not using > positions you could handle it that way at the expense of an additional > String instance for each match. Even if it did, I think the point remains that StringScanner#pos wouldn't be of much use if it gave a character offset, since str[n..m] is an expensive operation in ruby 1.9. If all you want is the rest of the string, then StringScanner#post_match gives you that already, doesn't it? But I think the OP wanted to get the buffer between two arbitrary match positions. -- Posted via http://www.ruby-forum.com/.