I have the following data sent by an external system which needs to be parsed for a particular Key
<ContextDetails>
<Context><Key>ID</Key><Value>100</Value></Context>
<Context><Key>Name</Key><Value>MyName</Value></Context>
</ContextDetails>
I tried parsing this with the regex to fetch the value for the KEY : Name
<Context><Key>Name</Key><Value>.</Value></Context>
but the result is blank
What is the change I need to do to fix this regex
If this is XML, load it into an
XDocumentand query that.See the answer from @Jens for details on how to do this.