Knp\Bundle\KnpBundlesBundle\Finder\Google::extractUrlRepository PHP Method

extractUrlRepository() protected method

protected extractUrlRepository ( $url )
    protected function extractUrlRepository($url)
    {
        if (preg_match('/https?:\\/\\/(www.)?github.com\\/(?<username>[\\w_-]+)\\/(?<repository>[\\w_-]+)/', $url, $matches)) {
            return $matches['username'] . '/' . $matches['repository'];
        }
        return null;
    }