Matching url path with regex in $urlRouterProvider.when()
问题 Based on the angular ui-router wiki (https://github.com/angular-ui/ui-router/wiki/URL-Routing#urlrouterprovider) it should be possible to use regex for matching the incoming path. How could I express regex to match following redirection rules: $urlRouterProvider .when('', '/events') .when('/', '/events') .when('/:eventName', '/events/:eventName') .when('/results', '/events/results') Test example: localhost => localhost/#/events localhost/ => localhost/#/events localhost/myEvent => localhost/#