更新时间:2023-01-19 21:51:26
XPath 2.0 和 XQuery 1.0(由 W3C 标准化)通过 matches
函数支持正则表达式http://www.w3.org/TR/xpath-functions/#func-matches:
XPath 2.0 and XQuery 1.0 (as standardized by the W3C) have regular expression support with the matches
function http://www.w3.org/TR/xpath-functions/#func-matches:
/user[matches(firstname, 'xxx$')]
当然还有像 starts-with
和 contains
(都在 XPath 1.0/2.0 中)和 ends-with
(仅在 XPath 2.0 中)可能就足够了.
And of course there are functions like starts-with
and contains
(both in XPath 1.0/2.0), and ends-with
(only in XPath 2.0) that might suffice.