arc/HTML-Selector-XPath — comment on commit 97a147d72644065d7348f110d18683805450c8a9
File: lib/HTML/Selector/XPath.pm line 26
By arc:

I find the negative-lookahead version easy to read; "a non-empty sequence of letters, digits, hyphens and underscores, except where that sequence begins with a digit, or a hyphen followed by a hyphen or digit". It also matches the wording used in [the spec][]: "identifiers […] can contain only the characters [a-zA-Z0-9] and ISO 10646 characters U+00A0 and higher, plus the hyphen (-) and the underscore (_); they cannot start with a digit, two hyphens, or a hyphen followed by a digit".

But I don't have a strong opinion on which version is better, so feel free to rewrite to the version you suggest.

It occurs to me that perhaps some additional tests for attribute-value identifier parsing would also be valuable; would you like me to do that?

[the spec]: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier