-
-
Notifications
You must be signed in to change notification settings - Fork 5k
Path as regex instead of strings #1177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Paths are not regexes, they're transformed to regexes. |
I don't really need to use custom regex, though it would make the path system more flexible. I just want a way to match everything BUT something specific. This is an alternate solution to my problem caused by #1176 , meaning that my wildcard route could have exceptions for the routes i add dynamically. |
Or maybe, replace the wildcard route with something that always matches anything unmatched, that is always checked last |
Like routes: [{...}], notFound: {...} |
Since the current route matching is completely done by path-to-regexp, it's very unlikely to add such feature in vue-router. @Dadibom can you check out path-to-regexp's docs and see if it's features can work for your use case? |
I should have referenced this when I saw it 😄 pillarjs/path-to-regexp#99 Anyway, I don't think we need to add anything. We should look at #1176 instead |
Yes, we should close this because the real issue is #1176 |
Vue.js / vue-router versions
2.1.10 / 2.2.1
Trying to add a route with a negative lookahead regex,
path: '/(?!PathThatShouldNotBeMatched)'
, however the exclamation mark is automagically escaped before passed to the regex tester.The text was updated successfully, but these errors were encountered: