The matches function acts against a string (where the result is a single item of type string). Looking for a way with XPath to do the same regular expression matches but against items (result is a sequence of nodes/items)?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
//foo/bar[matches( ., 'regexp' )]
Is this what you're looking for or am I misunderstanding your question. This filters the //foo/bar
nodelist based on the string value of every node. (The string value of elements is the concatenation of all the text nodes within it.)