Return the matched path/regex #296
Closed
chris-hinds-cko
started this conversation in
General
Replies: 1 comment
-
The library doesn't keep the initial input around at all, so this isn't possible today. You will need to write a small wrapper for yourself. Since it's all compiled into a regex, I don't think we even have the information in the return that'll tell you which one matched. But a simple |
Beta Was this translation helpful? Give feedback.
0 replies
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.
-
How can I return the regex path that was matched?
I.e. if I path an array of possible paths e.g.
["/foo/:id", "/bar/:id]
and then I call
match(["/foo/:id", "/bar/:id])
Can I figure out which of these paths was the matched one? I thought this is what the
index
in the return was referring too but that index always seems to be0
Beta Was this translation helpful? Give feedback.
All reactions