From: "John W. Long" Date: 2004-01-31T14:13:01+09:00 Subject: Re: regex bug? -----"Zach Dennis" wrote:----- > command.gsub!( /\[#{key}\]/ , "#{attrib}" ) replace this line with: command.gsub!( /\[#{key}\]/ , "#{Regexp::quote(attrib)}" ) > Any idea why it keeps stealing my \4? Because in gsub terms \4 represents the forth grouping: "123412341234".gsub(/(.)(.)(.)(.)/, '\4') => "444" You don't have any groupings in your expression so '\4' is equivalent to ''. -- John