"kebabcase" should not allow leading, trailing or repeated hyphen
https://html-validate.org/rules/class-pattern.html (and others)
"kebabcase" matches lowercase letters, digits and dash ([a-z0-9-])
However practically, these cases are generally considered invalid too:
-hello
hello-
hello--world
To report an error for those too, the regex should be changed to:
^[a-z](?:(?:[a-z0-9]*-(?!-))*[a-z0-9]+)?$
Edited by Hub Misto