I have an xml in the form of a string. Let’s say that the element name is TestDate and the date is the form YYYY-MM-DD. So in other words <TestDate>1950-03-31</TestDate>.
How do I find this.
Lets say I have string xml;
xml contains the element TestDate. I want to get that using a regular expression.
string regularExpression = @"";
Regex regex = new Regex(regularExpression , RegexOptions.Compiled);
What should be going in for regular expression.
If you want search data in that element only than itshould be
Another aproach is to use XPath. Load xml string in XmlDocument and extract all similar nodes. Below code will return all TestDate Nodes.