Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
匹配函数作用于字符串(结果是字符串类型的单个项目)。正在寻找一种使用 XPath 进行相同正则表达式匹配但针对项目的方法(结果是一系列节点/项目)?
//foo/bar[matches( ., 'regexp' )]
这是你要找的还是我误解了你的问题。这会//foo/bar根据每个节点的字符串值过滤节点列表。(元素的字符串值是其中所有文本节点的串联。)
//foo/bar