From: Benedikt Heinen Date: 2005-11-22T21:34:54+09:00 Subject: Re: newbie question > irb(main):001:0> name = "Jasmine" > => "Jasmine" > irb(main):002:0> phrase = "ja" > => "ja" > irb(main):003:0> name.sub(/ja/i, '**') > => "**smine" > irb(main):004:0> name.sub(/phrase/i, '**') > => "Jasmine" Just the same way you do variable substitution in strings (like in puts): irb(main):005:0> name.sub(/#{phrase}/i, '**') => "**smine" Benedikt ALLIANCE, n. In international politics, the union of two thieves who have their hands so deeply inserted in each other's pockets that they cannot separately plunder a third. (Ambrose Bierce, The Devil's Dictionary)