static int compareSemVer(String semVer1, String semVer2) {
        String[] versionComponents1 = semVer1.split("\\.");
        String[] versionComponents2 = semVer2.split("\\.");

        int maxLength = Math.max(versionComponents1.length, versionComponents2.length);
        for (int i = 0; i < maxLength; i++) {
            // Treat all implicit components as 0's
            String component1 = i >= versionComponents1.length ? "0" : versionComponents1[i];
            String component2 = i >= versionComponents2.length ? "0" : versionComponents2[i];
            int comparison = component1.compareTo(component2);
            if (comparison != 0) {
                return comparison;
            }
        }
        return 0;
    }
SemVer regex from semantic version spec.
@see <a href="https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string">SemVer</a>
smithy-model/src/main/java/software/amazon/smithy/model/transform/FilterDeprecatedRelativeVersion.java