From: Matt Armstrong Date: 2002-12-14T05:27:29+09:00 Subject: Re: [RCR] Global Regexp Match Mechanism (//g) "Austin Ziegler" writes: > Why should the String keep track of the "pos" if the string has been > mutated? In the code that I am trying to convert, if the string is > modified, the code itself is responsible for resetting the \G > position. IMO, the functions which prepend should invalidate the > matchpos (e.g., nil). That's a solution, though as Nobu Nakada pointed out the whole idea of having the String keep track of "pos" at all is flawed -- since it is not thread safe. Also, String#index and an extended Regexp#match that takes an index allow the user to manage "pos" themselves in however they see fit.