Search code examples
xpathxpath-2.0

Xpath 'Like' operator to find value in html


I have an html page which I would like to run a xPath query against to find any elements which have the id, name etc containing or like a value e.g name = 'tv_11223344' or name = 'tv_11223344'.

Been looking on line and through some old books but I cant find anything which looks like it will help me out.

Any ideas or suggestions are greatfully looked forward to!


Solution

  • In XPath 2.0 there is support for regular expressions.

    Have a look at the standard function matches().