code: public static User fromPrefix(String prefix) {
          Matcher matcher = userPrefixPattern.matcher(prefix);
  
          if (matcher.find()) {
              String nick = matcher.group(1);
              String user = matcher.group(4);
              String host = matcher.group(5);
  
              return new User(nick, user, host);
          } else {
              return null;
          }
      }
docs: Construct a new IRCUser from the give String. The String should be in the
  format {@literal <nick>!<user>@<host>}. This format is the same as is
  used in IRC message prefixes
  
  @param prefix The prefix to extract the information from
  @return a new IRCUser object or null if the prefix could not be parsed