code: def parse(version):
      
      match = _REGEX.match(version)
      if match is None:
          raise ValueError('%s is not valid SemVer string' % version)
  
      verinfo = match.groupdict()
  
      verinfo['major'] = int(verinfo['major'])
      verinfo['minor'] = int(verinfo['minor'])
      verinfo['patch'] = int(verinfo['patch'])
  
      return verinfo
docs: Parse version to major, minor, patch, pre-release, build parts.