Good day Brom
This might not be the solution you were looking for but it will definitely provide one of the many help.
I would use this regex to extract all the tags
(<\/[a-z]*>)+(<[a-z]*>)+|(<[a-z]*>)+(<\/[a-z]*>)+|(<[a-z]*>)+|(<\/[a-z]*>)+
Example:
string input = "<tr><td>abc</td><td>1</td><td>def</td></tr><tr><td>aaa</td><td>2</td><td>bbb</td></tr>";
string replacement = "#";
string pattern = "(<\/[a-z]*>)+(<[a-z]*>)+|(<[a-z]*>)+(<\/[a-z]*>)+|(<[a-z]*>)+|(<\/[a-z]*>)+";
RegexOptions options = RegexOptions.IgnoreCase | RegexOptions.Compiled |
RegexOptions.Multiline;
Regex rgx = new Regex(pattern, options);
string result = rgx.Replace(input, replacement);
// result == "#abc#1#def#aaa#2#bbb#"
This regex expression will grab the tags as groups or as individuals and then you could replace it with a delimiter line a pipe "|" or "#" and split on that.
I hope this helps.
Kind Regards
Ps. Regex explanation:
Pipes are used as or operators
(<\/[a-z]*>)+(<[a-z]*>)+ // Closing tag(s) that are followed by opening tag(s)
(<[a-z]*>)+(<\/[a-z]*>)+ // Opening tags followed by closing tags
(<[a-z]*>)+ // one or more opening tags
(<\/[a-z]*>)+ // one or more closing tags