Simple code to check format of user inputted email address
My preference for accepting user input in a blocking loop like this might look more like:

  public enum Returned { OK, ERROR_EMAIL };


…

  // Long loop here to get valid user registration info.
  /* In a transactional/event-driven (GUI, web) app this would not be
   * a loop, but with a blocking/modal (tty) program it works. */

  UserInfo u = new UserInfo ();
  // loop until you get valid one(s)
  while (!u.isReady()) {

    // for each field that must be validated, prompt and try to set it
    if (u.getName () == null) {
        System.out.print ("Enter an eMail address:");
        String entered = scanner.nextLine ();

        Returned settingName = u.setName (entered);

        // check each object's validity and report errors
        switch (settingName) {
            case Returned.OK:
                  System.out.println ("OK.");
                  break;
            case Returned.ERROR_EMAIL:
                  System.out.println ("That does not look like a valid eMail address.");
                  break;
             // No "default": if you add new error types later, you can handle them here.
             // The compiler will issue a warning about unhandled enum cases
        }
     }
  }


…and then in class UserInfo …

  final static Pattern rfc2822 = Pattern
                            .compile ("[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&amp;'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?");

  public Returned setName (final String address)
  {
       Returned valid = isValid(address);
       if (Returned.OK == valid) { this.name = address; }
       return valid;
  }

  public boolean isValid (final String address)
  {
         return ( (rfc2822.matcher(address).matches ())
                  ? Returned.OK : Returned.ERROR_EMAIL );
         // you could also check for a valid MX record for the domain part…
  }

  public boolean isReady () {
         return name != null; // and whatever else
  }