Skip to content

Commit bbf38d7

Browse files
authored
Remove reference to unimplemented feature
path-to-regexp does not support this syntax at all. There was a PR to implement it, but it seems pretty dead. pillarjs/path-to-regexp#362
1 parent 3def603 commit bbf38d7

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed

en/guide/routing.md

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -216,31 +216,6 @@ In express 5, Regexp characters are not supported in route paths, for more infor
216216

217217
{% include admonitions/caution.html content=warning-regexp %}
218218

219-
To have more control over the exact string that can be matched by a route parameter, you can append a regular expression in parentheses (`()`):
220-
221-
```
222-
Route path: /user/:userId(\d+)
223-
Request URL: http://localhost:3000/user/42
224-
req.params: {"userId": "42"}
225-
```
226-
227-
{% capture escape-advisory %}
228-
229-
Because the regular expression is usually part of a literal string, be sure to escape any `\` characters with an additional backslash, for example `\\d+`.
230-
231-
{% endcapture %}
232-
233-
234-
{% include admonitions/warning.html content=escape-advisory %}
235-
236-
{% capture warning-version %}
237-
238-
In Express 4.x, <a href="https://github.com/expressjs/express/issues/2495">the `*` character in regular expressions is not interpreted in the usual way</a>. As a workaround, use `{0,}` instead of `*`. This will likely be fixed in Express 5.
239-
240-
{% endcapture %}
241-
242-
{% include admonitions/warning.html content=warning-version %}
243-
244219
<h2 id="route-handlers">Route handlers</h2>
245220

246221
You can provide multiple callback functions that behave like [middleware](/{{ page.lang }}/guide/using-middleware.html) to handle a request. The only exception is that these callbacks might invoke `next('route')` to bypass the remaining route callbacks. You can use this mechanism to impose pre-conditions on a route, then pass control to subsequent routes if there's no reason to proceed with the current route.

0 commit comments

Comments
 (0)