How can I create an XPath expression that works like a regex would, so that it matches instances of next? Here’s an example of what I want using regex syntax:
string = 'blah_blah next '
xpath="//a[contains(text(),'.*?next.*')]");
I’m new to XPath, and searching through tutorials didn’t help me.
In XPath 1.0, this expression does what you want:
From http://www.w3.org/TR/xpath/#section-String-Functions
For more complex matching ussing RegExp you need a XPath 2.0 processor having this built-in functions:
match(),replace(),tokenize(), etc.