@Nullable public static String extractMajorVersionFromSemanticVersion(String semanticVersion){
  Matcher matcher=SEMANTIC_VERSION_REGEX_PATTERN.matcher(semanticVersion);
  if (matcher.find()) {
    return matcher.group(1);
  }
 else {
    return null;
  }
}

@ Nullable public static String extractMajorVersionFromSemanticVersion ( String semanticVersion ) { Matcher matcher = SEMANTIC_VERSION_REGEX_PATTERN . matcher ( semanticVersion ) ; if ( matcher . find ( ) ) { return matcher . group ( 1 ) ; } else { return null ; } }
return major version of the given semantic version . for example , ` v2 ` is returned from ` v2 . 10 ` . return null if major version cannot be extracted .
