Use regex for specificity

And added getValues() (for easier testing) and changed to compareTo, in
line with the CssSelector component.