If you have a String, lets assume: AB--AB
. I want to look for nodes with xpath which can be AB??AB
, meaning that the question marks in the node attribute are some kind of a placeholder - and they can vary in their amount of occurrence, so it should also be matched to AB?-AB
for example. How can you solve this?
XPath 2.0 has regular expression support: matches($string, 'AB.{0,2}AB')
would match if the string is a sequence of the literal AB
followed by zero, one or two arbitrary characters followed by the literal AB
.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments