I have previously added the following code in /wp-includes/user
but it restricts registration to only front-end user. I want to put restriction on back-end user addition.
elseif (!preg_match('#[@.]gmail.com$#i', $user_email){
$errors->add( 'invalid_email', __( 'ERROR: Only "gmail.com" email address allowed.' ) );
$user_email = '';
}