Reading this question, it seems Regex is the solution to my problem.
This is the HTML I'm trying to split:
\n\t\t\t
<td class=\"stats_name\">
Damage \n\t\t\t
<td class=\"stats_value\">
53 \n\t\t\t
<td class=\"stats_modifier\">
(<span class=\"ability_per_level_stat\">+3.2 / per level</span>) \n\t\t\n\t\t
</td>
</td>
</td>
For my reasons, I need to split this on the <td
string. This worked well enough with HtmlAgilityPack and String.Split, however the delimiter is removed and I need it present.
var statCells = rowDocument.DocumentNode.InnerHtml.Split(new string[] {"<td"}, StringSplitOptions.RemoveEmptyEntries).ToList();
And here's the same "function" using Regex to keep the delimeter, however it doesn't work as expected and is returning far too many strings, I think it's splitting on "<" "t" and "d" individually.
var statCells = Regex.Split(rowDocument.DocumentNode.InnerHtml, @"(?<=[<td])").ToList();
How can I use Regex.Split to split on "<td"
?