std.xml2 (collecting features)

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Thu Feb 25 16:31:31 PST 2016


On Thursday, 25 February 2016 at 23:59:04 UTC, crimaniak wrote:
> Where is only a couple of ad-hoc checks for attributes values. 
> This language is not XPath-compatible, so most easy way to 
> cover a lot of cases is regex check for attributes. Something 
> like "script[src/https:.+\\.googleapis\\.com/i]"

The css3 selector standard offers three substring search: 
[attr^=foo] if it begins with foo, [attr$=foo] if it ends with 
foo, and [attr*=foo] if it includes foo somewhere. dom.d supports 
all three now.

So for your regex, you could probably match: 
[attr*=googleapis.com] well enough.


More information about the Digitalmars-d mailing list