3 ms·
W3C is explicit: ranges are Unicode code points. [a-9] is not a valid range (since 9<a). [0-z] is, but as you say it is misleading and you probably shouldn't.
by sonofgod 8y ago
W3C is explicit: ranges are Unicode code points.
[a-9] is not a valid range (since 9<a). [0-z] is, but as you say it is misleading and you probably shouldn't.
There is a ambiguity that [A-Z] can be legally interpreted as "any of the characters A, hyphen, or Z". A rule specifying that hyphens must be first or last in the list would resolve this problem.
Also, good luck encoding
NameStartChar := ":" | [A-Z] | "_" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]
without ranges.