I'm trying to create a snippet of regex that will match a URL route.
Basically, if I have this route /users/:id
I want /users/100
to match, but /users/100/edit
not to match.
This is what I'm using now: users/(.*)/
but because of the greedy match it's matching regardless of what's after the user ID. I need some way of "breaking" the match if there's an /edit
or something else on the end of the route.
I've looked into the Regex NOT operator but with no luck.
Any advice?