Bad regexes in the new css.syx
Posted: 02 Aug 2022 20:00
According to W3C,
Could you please update css.syx with the new regexes (for #IDs and .classes)? Thank you!
Regex in the newest (posted in the forums) css.syx doesn't observe this (all IDs above the empty line should be yellow, while none of the IDs below it should be yellow): I have prepared better one (not perfect, but covers most of the basic cases): It goes like this:In CSS, identifiers (including element names, classes, and IDs in selectors) 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.
https://www.w3.org/TR/CSS2/syndata.html
Code: Select all
#-?[a-zA-Z_][a-zA-Z0-9_\-]+