Since my terrible experience with cssparser, I set myself the task of embedding a CSS parser in Java using Parboiled . I already have all the color specs, but of course I need everything else ...
So, I went looking for the CSS specification and found it on the W3C website. I am now in the process of writing the rules for all the "atoms", but found something disturbing in this section :
UNICODE-RANGE u\+[0-9a-f?]{1,6}(-[0-9a-f]{1,6})?
The part that bothers me is the question mark in [0-9a-f?] .
The heading of the paragraph says that the regular expressions used here are Lex style. ? doesn't really matter in the character class (thanks @scizzo for confirmation). So is this a typo in the W3C specification, or ? really allowed in unicode range? If so, what does it mean?
Wrap . I have my answer. However, the specification is incorrect: the “unicode range of the question mark” can only be on its own. Given the expression above, this expression will be allowed, while it is clearly illegal: u+4??-733f
source share