I have a regex pattern I need to match in ui-router (docs). I have a regexp tested outside of angular ready:
(?=.*\d)(?=.*[a-zA-Z0-9])\w{8}
I need 8 characters, one of which is a digit in any position.
When I insert it into my angular app, I get routing errors. Here's my code:
var accountNumberParam = '{accountNumber:(?=.*\d)(?=.*[a-zA-Z0-9])\w{8}}',
var states = [
{
name: 'name',
url: '/' + accountNumberParam,
templateUrl: '/path/to/my.html',
controller: 'MyCtrl'
},
]
I've tried with and without leading/trailing "/" characters. I think this is a formatting issue but I can't find anything different about the way this is formatted and the documentation. Thanks for the help.