![]() |
|
[.NET] Using regex match function to modify data? - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444) +--- Forum: Coding (https://hackforums.net/forumdisplay.php?fid=151) +---- Forum: Software Development (https://hackforums.net/forumdisplay.php?fid=118) +---- Thread: [.NET] Using regex match function to modify data? (/showthread.php?tid=5396888) |
Using regex match function to modify data? - Whateva_ - Sep 5, 2016 I want trying make a program which will look for a expression <disp-formula id="deqn(\d+)-(\d+)"> in files and if there is one or more match, then it will search the whole file for expressions in the form <xref ref-type="disp-formula" rid="deqnX">(X)</xref> or <xref ref-type="disp-formula" rid="deqnX">X</xref> where X ranges from the first (\d+) to the last (\d+) and replace it to <xref ref-type="disp-formula" rid="deqn$1-$2">(X)</xref> or <xref ref-type="disp-formula" rid="deqn$1-$2">X</xref>. This is what I've come up with so far, Code Dim targetDirectory As String = TextBox1.TextCan anyone help me on this?? * - Chickendipper - Sep 5, 2016 Why not use some sort of XML parser? There's a gazillion of them built in to the .NET framework and all of them would make this much, much easier. |