private function match($url, SPIUrlWildcard $wildcard) { if (preg_match($this->compile($wildcard->sourceUrl), $url, $match)) { return $this->substitute($wildcard->destinationUrl, $match); } return null; }