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

Why this complicated negated lookahead pattern?

I find the positive match easier to read:

(-?[_a-zA-Z][-_a-zA-Z0-9]*)

I'm never comfortable with negative lookahead. If the CSS3 rules actually discuss the pattern in terms of "unless it looks like a number", I'm OK with a negative lookahead here as well, but otherwise, I prefer to write the code in positive terms, that is, "It may start with a minus, but lastest then there has to come a letter, and after that, we don't care much anymore", instead of "We don't care much, but it shouldn't look like a positive or negative number".