Dirk Einecke wrote:

> Hi.
> 
> Marcin Miel?y?ski wrote:
> 
>> It should work for any tag
> 
> 
> But I do not unterstand this:
> 
> gsub!( /<(.+)>(.*?)<\/\1>/ ) { "<#{$1}>foo</#{$1}>" }
> 
> How this code take the var "tagName" ?

Should just be something like:

gsub!( /<(#{tagName})>(.*?)<\/\1>/ ) { "<#{$1}>foo</#{$1}>" }