From: Simon Krahnke Date: 2007-08-14T07:04:58+09:00 Subject: Re: confused by back refs in gsub * Peter Bailey (21:18) schrieb: >> line.gsub!(/(.*)<\/registrantName>/,'\1') > Thank you, Jano. Yes, this worked for me now. Please note that regular expressions aren't a very good way to parse XML. The above expression subgroup will match everything between the first "" and the last "" which is probably not what you want. You can can use non-greedy *? as a workaround in this case. mfg, simon .... l