There will always be edge cases (PHP uses
CamelCase for classes), but I find that sticking with each language’s word combination patterns make for the least friction possible.
With that said, here are my current choices:
With html, the
data- prefix is one defense, even though attributes like
tabindex differ. Also, an underscore is technically meant to augment a letter or word, while a hyphen is used to separate words or syllables.
Regular Expression engines use the same characterizations.
For example, using the text:
with the regex matching pattern:
the resulting array of matches is:
 => some  => word  => some_word
This may seem like I’m over-thinking things, but like I said, I want the least amount of friction when I work.