private void parse(String version) throws IllegalArgumentException {
		if (version == null) {
			throw new IllegalArgumentException("Version is null");
		}

		tag = "";
		int dashIndex = version.indexOf('-');
		if (dashIndex != -1) {
			if (dashIndex + 1 < version.length()) {
				tag = version.substring(dashIndex + 1);
			}
			version = version.substring(0, dashIndex);
		}

		String[] versionParts = version.split("\\.");
		if (versionParts.length == 2) {
			major = parse(versionParts[0], "major");
			minor = parse(versionParts[1], "minor");
			patch = 0;
		}
		else if (versionParts.length == 3) {
			major = parse(versionParts[0], "major");
			minor = parse(versionParts[1], "minor");
			patch = parse(versionParts[2], "patch");
		}
		else {
			String plural = version.length() > 1 ? "s" : "";
			throw new IllegalArgumentException(
				"Version '" + version + "' has " + versionParts.length +
					" part" + plural + " but 2 or 3 are required");
		}
	}
Parses the major, minor, patch, and tag components out of the given version string.

@param version A version string.
@throws IllegalArgumentException if the version string failed to parse.  The 
  exception's message has more detailed information about why it failed.
Ghidra/Framework/Utility/src/main/java/ghidra/framework/ApplicationVersion.java