From: Robert Klemme Date: 2004-09-28T16:24:22+09:00 Subject: Re: keep changes in string outside of scope? "James Edward Gray II" schrieb im Newsbeitrag news:CFC5333A-10CF-11D9-8CFB-000A95BA45F8@grayproductions.net... > > What about: > > > > thestring.gsub!(/(\d{5})/, '\1') > > Oops, forgot the period. The replace string should be '.\1'. Sorry He wanted a comma... :-) And without diving too far into escape handling I'd use thestring.gsub!(/\d{5}/, ',\\&') Note also, that you don't need the grouping. robert