I am having hard time finding out how can I get AngularJS not to ignore whitespaces in strings. Im trying to validate password requirements with AngularJS directive and regex pattern and problem is that I dont want to allow leading or trailing whitespace in password.
Here is fiddle http://jsfiddle.net/GX5Kr/9/
var regex = /^(?=.*[0-9])(?=.*[a-zA-Z])([a-zA-Z0-9]{5,})$/;