I have an HTML page with <tr>
classes and I need to capture the text inbetween those tags.
I tried with Regex
:
(?i)<tr[^>]*?>([^<]*)</tr>
But it doesn't work.
This is all my code in C#:
string patternPost = @"(?i)<tr[^>]*?>([^<]*)</tr>";
MatchCollection m1 = Regex.Matches(html, patternPost, RegexOptions.Multiline);
foreach (Match m in m1)
{
MessageBox.Show(m.Groups[1].Value);
}
Here you can find an example of HTML page: http://pastebin.com/ewN5NZis
You can see 2 block, I need to store for each of blocks, three info in three different list:
List 1: Title1, Title2
List 2: John, Antony
List 3: 29/04/14, 28/04/14
With my first regex I wanna try first to catch all blocks and skip useless information like tags differents from tr and next I wanna try to catch 3 infos for each blocks with 3 different regex. Is this right? I hope now you understand me.