Is it possible to use regular expressions inside of an xpath statement executed by System.Xml.XmlDoc

  • Thread starter Thread starter Daniel
  • Start date Start date
D

Daniel

Is it possible to use regular expressions inside of an xpath statement
executed by System.Xml.XmlDocument.SelectSingleNode() ?

string sdoc = "<foo><bar a='1'/><bar a='2'/></foo>";
System.Xml.XmlDocument pdoc = new System.Xml.XmlDocument();
pdoc.LoadXml(sdoc);
System.Xml.XmlNode pnode =
pdoc.SelectSingleNode("//foo/bar/matches(.,'\\d')");
string foo = pnode.InnerText;
int i23 = 23 + 23;
 
Back
Top