if( $em =~ /^(\w[\w|\.]).*@(\w\w).*\.(\w+)$/ ) { $em = $1 . '.' x (length($name) - 2) . "\@$2" . '.' x (length($comp) - length($3) - 2) . $3; }