From: Gavin Kistner Date: 2006-10-21T01:14:55+09:00 Subject: Re: Problem modifying captured regexp results From: Paul van Delst [mailto:Paul.vanDelst@noaa.gov] > So can someone elaborate on why the above split operation on > captured regexp results seems > to bugger up the other captured results? Does this issue > extend to *any* operation on > captured regexp results? That's what you get for using the (thread-local) global variables that change with each regexp operation. Regexp.match returns a MatchData object that will allow you to save your results from a previous operation and not have them changed by later code. See the $~ variable, http://phrogz.net/ProgrammingRuby/tut_stdtypes.html#objectorientedregula rexpressions and http://phrogz.net/ProgrammingRuby/ref_c_matchdata.html