Dirk Einecke wrote:

> 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 just came across a few regex resources on the web today so I'll post:

Example Regex Expressions (Markup Category)
http://www.regexlib.com/DisplayPatterns.aspx?cattabindex=4&categoryId=8

Regex Cheatsheet (useful despite being .NET)
http://www.regexlib.com/CheatSheet.htm

Regex Coach (free/donationware) GUI tool for both Linux and Windows
http://weitz.de/regex-coach/