From: Nate Wiger Date: 2006-11-10T08:09:19+09:00 Subject: Re: Can't get eval to reference $1, $2, etc Answered my own question (of course)... here's a way to do this by using sub instead of match/eval, which is much safer too: path = file.dup rules.each do |row| dest = row[1] || '' dest.gsub!('$','\\') # allow $Perl or \Sed markers if path.sub!(%r{^#{row[0]}$}, dest) return path end end -Nate