From 06f541aff94f52a25546b879af8bd6780104816d Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 31 May 2017 09:56:17 +0100 Subject: [PATCH] Forward slash regex alternative When using the _format parameter in a route with the existing regex to allow slashes, it will append the _format onto your parameter value. Providing an alternative regex for this scenario. --- routing/slash_in_parameter.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routing/slash_in_parameter.rst b/routing/slash_in_parameter.rst index a7415fb165b..fff88377611 100644 --- a/routing/slash_in_parameter.rst +++ b/routing/slash_in_parameter.rst @@ -76,3 +76,9 @@ a more permissive regex path. return $collection; That's it! Now, the ``{username}`` parameter can contain the ``/`` character. + +Routes with ``_format`` parameter +------------------- + +Using the expression ``.+`` with the ``_format`` parameter will match the ``.{_format}`` from your route. For example it will output a username of ``test/test`` as ``test/test.html``. +When using the ``_format`` parameter you can use ``[^.]+`` (providing your parameter value doesn't contain dots).