title: Check if all the 5 digits in a given 5 digit number are same
body: <p>I want to show an alert if all the 5 digits in a given 5 digit number are same for example 11111, 22222, etc. Here is my fiddle <a href="http://jsfiddle.net/09k8f5s4/36/" rel="nofollow">http://jsfiddle.net/09k8f5s4/36/</a> and below is my code which is not working. Any help would be appreciated.</p>
  
  <pre><code>&lt;div ng-app="app" ng-controller="test"&gt;
        &lt;input type="text" ng-model="value"/&gt;
       &lt;button ng-click=check()&gt;Check&lt;/button&gt;
   &lt;/div&gt;
  
  angular.module('app', [])
    .controller('test', function($scope) {
        $scope.check = function() {
            if(/(\d)\1{2}-\1{3}-\1{4}/.test($scope.value)) {
              alert("Invalid number");      
            }
        }
  });
  </code></pre>