I run a Drupal 6 site that gets a lot of registrations every day and sometimes people register with their email address as their username. The problem is that the username is displayed anytime that user posts content on the website so we try to discourage this. I finally got fed up and just wrote a bit of code that uses hook_user and would go into your custom module. It looks something like this:
function custommodule_user($type, &$edit, &$account, $category = NULL) {
if ($type == 'validate') {
$regexp = '/^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/';
if (preg_match($regexp, $edit['name'])) {
form_set_error('name', "Do not enter an email address
in the username field as it is publicly viewable.");
}
}
}
Replace custommodule with the name of your module. The rest of the code simply looks to see if the validate operation is being performed, checks the name form field and does a simple preg_match to see if it looks like an email.