modified from my validation one. untested.
domain names cannot contain underscores, but can contain dashes.
usernames can contain weird characters as well, even @.
Skara wrote:
domain names cannot contain underscores, but can contain dashes.
While the topic is email, it is inaccurate to say that *domain names* cannot contain underscores. In fact the RFC's for domain names do allow them. *EMAIL* domains cannot contain underscores.
(However, it should be mentioned that all current versions of BIND by default do refuse to honor *domain names* with underscores, despite the RFC's allowing them.)