Update: I wrote up what I did, with source code and things to watch for, at - Adding XPath 2.0 functionality and variables to .NET XPath (my blog).
Is there a way to pass a regular expression to matches() for an XPath statement in .NET?
Example: do an xpath of
"/windward-studios/Employees/Employee[matches(string(LastName), '.*A?B[12]C.*')]"
XPath 2.0 supports the matches function. However, .Net implements XPath 1.0.
You would need to add a custom function to implement match. See http://msdn.microsoft.com/en-us/library/ms950806.aspx
It looks like the Mvp.Xml Project: EXSLT.NET module implements most of XPath 2.0; including matches. See http://mvp-xml.sourceforge.net/exslt/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With