Refactored ng-pattern regexp