更新时间:2022-10-15 09:45:19
string inputString = asjkdfkas djasdasdjasjd<> sfkasdfkaslkfa< NUM_AE> 147< / NUM_AE>< b> sdfsdfsdf< / b> sdfsdfsdfsdf;
正则表达式正则表达式= 新正则表达式( < ; NUM_AE><(*); / NUM_AE>中跨度>);
var regMatch = regex.Match(inputString);
string value = regMatch.Groups [ 1 跨度>]的ToString();
检查 RegEx C#:查找2个已知值之间的字符串 [ ^ ]
查看下面的链接
http:/ /***.com/questions/18250671/how-to-read-single-node-value-from-xml-file
Hi Friends
I need to find a value from an XML string. since my Xml string is messed up i am not able to parse. so my question is, whether with help of some regex expression or using any other way can i pick up the value
For example this is my
<NUM_AE>147</NUM_AE>
string
i need to get the value 147
How its possible?
thanks in advance
string inputString ="asjkdfkas djasdasdjasjd<>sfkasdfkaslkfa<NUM_AE>147</NUM_AE><b>sdfsdfsdf</b>sdfsdfsdfsdf"; Regex regex = new Regex("<NUM_AE>(.*?)</NUM_AE>"); var regMatch = regex.Match(inputString); string value = regMatch.Groups[1].ToString();
have a look at below link
http://***.com/questions/18250671/how-to-read-single-node-value-from-xml-file