-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
feature-requestUsed to close PRs that haven't gone through/been accepted the Proposal process yetUsed to close PRs that haven't gone through/been accepted the Proposal process yet
Milestone
Description
Let's make string-based pattern matching more flexible to accommodate some of the use cases we're starting to see.
In particular, I'd like to propose we follow Sinatra's lead here and:
- Allow
?
to mean "match the previous thing 0 or 1 time" - Modify
*
to not match . since it can be excluded using?
By just doing these two changes, we can support the following kinds of URLs:
/posts/:slug.?:format?
(make the.html
portion of a URL optional)/files/*.*
(get the file extension in a separatesplat
)/archive/?
(optional trailing slash)
I've already got this functionality in mach and it's working really well. I rarely (read: haven't yet needed to) use a regular expression to match on a URL path. I realize that this discussion will probably evolve to include supporting full-blown regular expressions, but I'd like to discuss that in a separate issue if people are interested.
Metadata
Metadata
Assignees
Labels
feature-requestUsed to close PRs that haven't gone through/been accepted the Proposal process yetUsed to close PRs that haven't gone through/been accepted the Proposal process yet