On Sun, 11 Jul 2004 19:14:19 +0200, Dirk Einecke wrote:

> <snip> 
> tagName = 'html'
> fileContent.gsub!( /<html>(.*?)<\/html>/ ) { 
> '<'+tagName+'>foo</'+tagName+'>' }
> 
> But how can I insert the var 'tagName' in the first part
>    ( /<html>(.*?)<\/html>/ )
> ?
> 
> Can anybody help me with this small problem?
> 

What about ( /<#{tagName}>(.*?)<\/#{tagName}/ )?
Does that solve your problem?

Kristof