[lxml-dev] matches()

Ian Bicking ianb at colorstudy.com
Tue May 29 06:00:42 CEST 2007


Ian Bicking wrote:
> Using lxml trunk:
>    doc.xpath('descendant-or-self::*[starts-with(lower-case(@href), 
> "javascript:")]')

Well, maybe this one doesn't work either (returns 1/0).  Now I'm just 
confused.

> works, but:
> 
>    doc.xpath('descendant-or-self::*[matches(@href, "^javascript:", "i")]')
> 
> Returns ["i"].  This does not seem right...?


-- 
Ian Bicking | ianb at colorstudy.com | http://blog.ianbicking.org
             | Write code, do good | http://topp.openplans.org/careers


More information about the lxml-dev mailing list