Parser Rules
The router will only match the URL
paths, notquery stringsorsearch parameters&hashoranchor.The paths will always be matched case-insensitively.
Eg:
/aboutis same as/About.The trailing slash
/will not be matched by default.Eg: The route
/docswill match path/docsbut not/docs/.A route segment can have
namedorunnamedorboththe parameters.The parameters name must be defined by prefixing the colon
:character to the name.Eg:
/users/:userID, here theuserIDis the parameter name.The parameters name must match this regular expression
[A-Za-z0-9_].The named parameters match their value using this regular expression
([^/]+).The named parameters default matching can be overridden by the
customregular expressions, the custom regex must be defined by suffixing(regexp)to the name.Eg:
/orders/:orderId(\d+), here the paramorderIDmatches only the digits.The unnamed parameters must be defined by
customregular expressions.Eg:
/photos/(.*)can match paths like/photos/my-family.jpg,/photos/selfie.png.The regexp
caputring groupsare not allowed inside thecustomregexp.Eg: This will throw an error
/photos/(.*.(jpg|png)). But this will not throw an error/photos/(.*).(jpg|png).The modifiers
*,+, and?must be placed after the parameter.Eg:
/:chapters*,/(.*)+,/docs/:slug?
