code: function parseOrigin(str) {
  	const match = str.match(/^([^!]+?)!([^@]+?)@(.+?)$/);
  	if (match) {
  		return new ClientOrigin(match[1], match[2], match[3]);
  	} else {
  		return new ServerOrigin(str);
  	}
  }
docs: note: we only validate the nick!user@host format and not what characters can or cannot be in each on failure to match, we assume str is a server origin