We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
var UrlPattern = require("url-pattern")
Is there any way to enforce regex at a segment level?
I have a pattern for username with a @.
username
@
The current route matchers are failing with the @.
var pattern = new UrlPattern(':username/:postID'); pattern.match('@stoplion/123');
I think I can build the regex like this..
var pattern = new UrlPattern(/@[a-z0-9][-a-z0-9]+)\/([a-z0-9][-a-z0-9]+)/, ['username', 'postIid']);
The URL itself is very hard to read, and I can't figure out what it is at a glance..
Is it possible to do something like this.. Where you can get the named segments, and then enforce a regex pattern
var pattern = new UrlPattern(':username/:postID', { username: /@[a-z0-9][-a-z0-9]+/ });
The text was updated successfully, but these errors were encountered:
No branches or pull requests
var UrlPattern = require("url-pattern")
Is there any way to enforce regex at a segment level?
I have a pattern for
username
with a@
.The current route matchers are failing with the
@
.I think I can build the regex like this..
The URL itself is very hard to read, and I can't figure out what it is at a glance..
Is it possible to do something like this..
Where you can get the named segments, and then enforce a regex pattern
The text was updated successfully, but these errors were encountered: