diff --git a/Uri/UriFactory.php b/Uri/UriFactory.php index 6e979c47f..50046873a 100644 --- a/Uri/UriFactory.php +++ b/Uri/UriFactory.php @@ -109,7 +109,7 @@ class UriFactory */ public static function build(string $uri, array $toMatch = []) { - return preg_replace_callback('(\{[\/#\?@\.\$][a-zA-Z0-9]*\})', function ($match) use ($toMatch) { + return preg_replace_callback('(\{[\/#\?@\.\$][a-zA-Z0-9\-]*\})', function ($match) use ($toMatch) { $match = substr($match[0], 1, strlen($match[0]) - 2); return $toMatch[$match] ?? self::$uri[$match] ?? $match;