From: Sebastian Hungerecker Date: 2008-12-16T21:09:50+09:00 Subject: Re: Help with an "easy" regular expression substitution Mark Thomas wrote: > excuse me... > > header.tr('*','X') > > Better? :) No, because you just changed the problem. The specified input was the whole string, not only the part of the string that should change. And the desired output was that whole string with the part that should be changed, changed 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. HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826