Your ng-pattern="regex" contains a string regex as its value. In order to refer to the real variable $scope.regex , you need to use the template syntax:
確定! 回上一頁