public function getVersions($pattern = null)
    {
        $versions = array_keys($this->versions);

        if (empty($pattern)) {
            return $versions;
        }

        $pattern = preg_replace('~\.~', '\\.', $pattern);
        $pattern = preg_replace('~[xyz]+~i', '\\d+', $pattern);

        $result = [];

        foreach ($versions as $version) {
            if (preg_match("~^{$pattern}~", $version)) {
                $result[] = $version;
            }
        }

        return $result;
    }