Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP


$route should allow regexps params #918

vojtajina opened this Issue · 11 comments

things like: /some/:param ([0-9]*)

or allow list of values, eg. /some/:param where param can be one of ['one', 'two', 'three']

Check out server side frameworks and their routing.


I would recommend /some/<param:[0-9]*> pattern.


Additionally, I'd like to be able to include slashes as valid strings in the match. This appears not to work currently.


@blainegarrett, you should have a look into PR #1560 as it allows matching arbitrary strings which also include slashes.

@xealot xealot referenced this issue from a commit
@xealot xealot This generally improves Angular routes in a backwards compatible way.
- A TODO where most routes was being compiled and processed every single route change. Routes are now processed up front and simply matched

- Routes are now processed in the order in which they are added instead of arbitrarily.

- Helps with #1147
- Helps with #1159
- Makes #918 easier

- It is now possible to match the forwardslash character.

- It is now possible to restrict your match to string, int or path.

@blainegarrett I was able to include slashes as valid string in my implementation just by extending the $routeProvider.shortcuts with { "path": { regex: "[\\w\\/]+" } } and then specifying the constraint for the parameter to be path. actually, I have exposed this shortcuts object, so that it is configurable from outside





@lrlopez lrlopez referenced this issue in angular-ui/ui-router

Enhanced route syntax #5

0 of 4 tasks complete

when will this merge to master?

@btford btford closed this

As part of our effort to clean out old issues, this issue is being automatically closed since it has been inactivite for over two months.

Please try the newest versions of Angular (1.0.8 and 1.2.0-rc.1), and if the issue persists, comment below so we can discuss it.


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.