From: Kristof Bastiaensen Date: 2004-07-12T05:37:35+09:00 Subject: Re: Syntax question for gsub On Sun, 11 Jul 2004 19:14:19 +0200, Dirk Einecke wrote: > > tagName = 'html' > fileContent.gsub!( /(.*?)<\/html>/ ) { > '<'+tagName+'>foo' } > > But how can I insert the var 'tagName' in the first part > ( /(.*?)<\/html>/ ) > ? > > Can anybody help me with this small problem? > What about ( /<#{tagName}>(.*?)<\/#{tagName}/ )? Does that solve your problem? Kristof