I don't think this is correct for standard names and also neglects premium names.
https://developers.eos.io/eosio-cpp/docs/naming-conventions
I came up with this, please let me know if it is incorrect:
Non Premium Account Names (gu3tambwg3ge):
Can only contain the characters abcdefghijklmnopqrstuvwxyz12345 a-z (lowercase), 1-5
Must be 12 characters
Excluded:
Must start with a letter - https://bloks.io/account/1b5gii3jjnz2
Must not end in a dot - cannot have a dot at all unless premium
and . (period) - cannot have a dot
Premium Account Names (xyz.xyz)
Can only contain the characters .abcdefghijklmnopqrstuvwxyz12345 a-z (lowercase), 1-5 and . (period)
12 characters max
1 characters min (Todd says premium names can start with a dot)
Must not end in a dot
This is a valid premium name: ....a..a.a ~ Todd