Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Regular expressions for converting HTML to XHTML

Status
Not open for further replies.

tcstom

Programmer
Aug 22, 2003
235
GB
Hi all,

I'm writing a filter that uses regular expressions to detect non-XHTML-compliant output in my .NET 1.1 applications. I don't have much experience of regular expressions so I'm a bit stuck. I've found advice elsewhere on the web to do some things such as removing the name attribute of the form tag and updating the postback javascript to use DOM. What I'm looking for though are regular expressions that can do the following when applied to a string:

- close any unclosed empty tags (e.g. <br> to <br />)
- replace any uppercase HTML tags and attributes with lowercase equivalent.

Once done I'm happy to publish the finished code so that all of us 1.1ers can go XHTML!

Thanks in advance.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top