From: Justin To Date: 2008-07-16T14:08:12+09:00 Subject: RegEx stuff a = [["a^b^^"], ["c&def"]] b= [] a.to_s.each_byte { |byte| (b.push(byte.chr) if !b.include?(byte.chr)) if byte.chr.match(/\W+/) } b.each do |c| a=a.to_s.gsub(c, "\\#{c}").to_a end p a => ["a\\^b\\^\\^c&def"] How come the & does not get subbed with '\\&' ?? I'm basically trying to substitute any special character with '\\#{special_character}' THANKS! -- Posted via http://www.ruby-forum.com/.