Does HtmlAgilityPack have the ability to use regular expressions in its XPATH selector?

ⅰ亾dé卋堺 提交于 2019-12-01 22:02:13
casperOne

No, the HTML Agility Pack does not currently support this. It supports XPath version 1 queries, which does not support regular expressions.

That said, you'll have to do as you recommended and select using the XPath expression up to the point where you want to use a regular expression, and then use the Where extension method to filter out the appropriate nodes based on an RegEx instance.

Simon Mourier

It's not available out-of-the-box, but you can add this functionality easily. It's described here: HtmlAgilityPack: xpath and regex

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!