>>>>> "t" == ts <decoux / moulon.inra.fr> writes: regexp are stupid :-) t> string.gsub!(/\b(width|height)=(['"])\d+\\2/) { "#$1=#$2#{rep[$1]}#$2" } string.gsub!(/\b(width|height)=(['"])\d+\2/) { "#$1=#$2#{rep[$1]}#$2" } \2 rather than \\2 Guy Decoux