Why doesn't react-router4 support regular matching?

The path-to-regexp used in

react-router4 supports the following modes:

var toPathRegexp = pathToRegexp.compile("/user/:id(\\d+)")

toPathRegexp({ id: 123 }) //=> "/user/123"
toPathRegexp({ id: "123" }) //=> "/user/123"
toPathRegexp({ id: "abc" }) //=> Throws `TypeError`.

but this mode is not supported in react-router4. Can you only use this / user/:id mode?


Yes,

<Route exact
    path="/test/:testId(\d+)"
    component={Test} />
Menu