code: def parse_user(raw):
      
      nick = raw
      user = None
      host = None
  
      # Attempt to extract host.
      if protocol.HOST_SEPARATOR in raw:
          raw, host = raw.split(protocol.HOST_SEPARATOR)
      # Attempt to extract user.
      if protocol.USER_SEPARATOR in raw:
          nick, user = raw.split(protocol.USER_SEPARATOR)
  
      return nick, user, host
docs: Parse nick(!user(@host)?)? structure.