From: gabriele renzi Date: 2004-07-12T02:27:26+09:00 Subject: Re: Syntax question for gsub il Sun, 11 Jul 2004 19:14:19 +0200, Dirk Einecke ha scritto:: maybe like this? >> tag2='miao' => "miao" >> 'miao'.gsub(/<#{tag}>.*?<\/#{tag}>/, '<'+tag2+'>foo') => "foo" otherwise you could use Regexp.compile: >> Regexp.compile tag+'.*?'+tag => /html.*?html/ or Regexp.new >> Regexp.new tag+'.*?'+tag => /html.*?html/ but, would'nt it be easier to do: gsub /<\/?#{tag}>/, tag2 ?