Since this isn't quite a repost - just very, very, very nearly...
You have been given a regex which returns the text content of the HTML. You just need to expand it to extract the text from the "li" section into separate matches, and then process them.
Since you are only interested in the "li" sections, It may be worth your while changing the regex to:
string inputText = "<ol><li>ONE</li><li>TWO</li><li>THREE</li></ol>";
Regex regex = new Regex("(?<=\\<li\\>)[^\\<]*(?=\\</li\\>)",
RegexOptions.IgnoreCase
| RegexOptions.CultureInvariant
| RegexOptions.IgnorePatternWhitespace
| RegexOptions.Compiled);
MatchCollection ms = regex.Matches(inputText);
string outText = "Matches:\n";
foreach (Match m in ms)
{
outText += m.Groups[0].Value + "\n";
}
I would strongly suggest you go to
www.ultrapico.com[
^] and D/L a copy of Expresso - it helps design, explain and test regular expressions. It's free, it generates C# or VB code for you, and it works brilliantly - I wish I'd written it!