Hello,
I have a problem when I try to accces elements of a XML file.
I need a way to extract the values for “start”, “end” and “level”, but the syntax is different.
Thanks in advance!
Hello,
I have a problem when I try to accces elements of a XML file.
I need a way to extract the values for “start”, “end” and “level”, but the syntax is different.
Thanks in advance!
You can try with regex Expression
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=start\D+)\d+").ToString
Output -> 2004
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=end\D+)\d+").ToString
Output -> 2008
System.Text.RegularExpressions.Regex.Match(YourString,"(?<=level\D+)\d+").ToString
Output -> 5
Regards
Gokul
Another way to get the extracted data using Regex @darie.leolea
System.Text.RegularExpressions.Regex.Matches(YourString,"(?<!\s\D)\d+",System.Text.RegularExpressions.RegexOptions.Multiline)
Regards
Gokul
Hi,
Can you share your xml as a file?
Regards,
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.