Standards: users and groups

From wikinotes

Usernames

Information Source
windows (see rules for logon names) https://docs.microsoft.com/en-us/previous-versions/windows/it-pro/windows-2000-server/bb726984(v=technet.10)
posix http://pubs.opengroup.org/onlinepubs/9699919799/nframe.html
linux(gnu) man useradd http://man7.org/linux/man-pages/man8/useradd.8.html
bsd man adduser https://man.openbsd.org/adduser

Windows

windows_char_limit = '(?!.{104,})'
windows_regex = '[^{}]+'.format(re.escape('/\\:;|=,+*?<>'))  # this intentionally includes most of UTF-8

Posix

posix_char_limit = ''
posix_regex = '[a-zA-Z_0-9._][a-zA-Z_0-9._{}-]+'.format(re.escape('\\'))

useradd (gnu)

# (src: man useradd)
linux_char_limit = '(?!.{32,})'
linux_regex = '[a-z_][a-z0-9_-]*'

adduser (bsd)

bsd_char_limit = '(?!.{16,})'
bsd_regex = '[a-z_][a-z0-9_-]*'