D
Dirk Einecke
Hi.
I've a litte syntax question. I read a HTML file and change all between
the html tag:
fileContent.gsub!( /<html>(.*?)<\/html>/ ) { '<html>foo</html>' }
Now I want to set the tag type dynamicly like this:
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?
greetings
Dirk Einecke
I've a litte syntax question. I read a HTML file and change all between
the html tag:
fileContent.gsub!( /<html>(.*?)<\/html>/ ) { '<html>foo</html>' }
Now I want to set the tag type dynamicly like this:
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?
greetings
Dirk Einecke