protected function buildRequirements(array $matches)
    {
        $result = [];
        foreach ($matches as $match) {
            list($key, $regexp) = $this->splitSegment($match[3]);
            $result[$key] = $regexp . ($match[1] == '(' ? '*' : '+');
        }

        return $result;
    }