On Dec 16, 7:09=A0am, Sebastian Hungerecker <sep... / googlemail.com> wrote: > Mark Thomas wrote: > > excuse me... > > > header.tr('*','X') > > > Better? :) > > No, because you just changed the problem. The specified input was the who= le > string, not only the part of the string that should change. And the desir= ed > output was that whole string with the part that should be changed, change= d > and the rest as-is. > You could of course do > text.sub(/X-Level: \*+/) {|header| header.tr("*","X") } > but that's not neccessarily simpler than the already offered solutions. You are correct, of course. And that's what I was trying to imply, that it was only solving one piece of the problem. I guess I should have explained it, rather than be glib with my response. If the header was easily (or already) isolated, it would be a simple solution. But that information was not given by the OP.