Can you apply a regular expression for a param? #488
Unanswered
yuliankarapetkov
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I currently have a route which I have configured to be
(foo|bar). So now my child route of example accepts the following combinations:However, when I navigate to my example page,
$page.pathis/(foo|bar)/exampleso I'm not able to tell if the first param isfooorbarunless I checklocation.pathname.On the other hand, if I rename my directory to be called
[myParam]instead of(foo|bar), all types of strings would match this route, like:So what directory name should I use to create a param called
myParamthat satisfies the regular expression(foo|bar)?StackOverflow link: click
Beta Was this translation helpful? Give feedback.
All reactions