Regex Efficiency Q - Manipulating Html

G

Guest

I have a string (resultHtml) which contains HTML screen scraped from a page in my application
I want to turn everything inside any html tags to lowercase.
I'm doing the following

string resultHtml = // Get the Htm
Regex regexLower = new Regex( @"<(.|\n)*?>",
RegexOptions.IgnoreCase|RegexOptions.Multiline|RegexOptions.IgnorePatternWhitespace|RegexOptions.Compiled)
MatchCollection colMatch = regexLower.Matches(resultHtml)
for (int i=0; i<colMatch.Count; i++
resultHtml.Replace(colMatch.ToString(), colMatch.ToString().ToLower())

This hardly seems efficient, is there a better way to do it
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,832
Latest member
GlennSmall

Latest Threads

Top