angular/angular.js — pull request #5923 by litera (2014-01-22 01:48:57+00:00)
Title: Added support for route parameter regular expression constraints

Adds support for route parameters with regular expression constraints:

/route/:parameter:regex/continued

This makes it possible to create a route i.e.

/user/:id:\\d+/:name?

Where parameter `:id` has numeric regular expression constraint. Double backslash has to be used because single one is stripped out by Javascript as it's used as an escape character and since "d" doesn't need escaping, it gets stripped out. We have to use double to preserve single one.

Route constraints work as follows:

1. parameters with constraints can't be optional or greedy
2. constraint regular expression can't have capture groups as all "(" and ")" are being escaped anyway (existing functionality)
3. regular expressions can't have forward slashes ("/") in them as they're route segment delimiters