Dnia 2004-07-11 19:14, U?ytkownik Dirk Einecke napisa?:

> But how can I insert the var 'tagName' in the first part
>   ( /<html>(.*?)<\/html>/ )
> ?
> 
> Can anybody help me with this small problem?
> 
> greetings
> Dirk Einecke

try:

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

or even:

gsub!( /<(.+)>(.*?)<\/\1>/,'<\1>foo<\1>' )

Marcin Mielzynski