javascript - Check if all the 5 digits in a given 5 digit number are same -
I want to show a warning if all 5 digits of 5 digits are similar to 11111, 22222, etc. This is my Bela is down and my code is not working which is not working. Any help would be appreciated.
& lt; Div ng-app = "app" ng-controller = "test" & gt; & Lt; Input type = "text" ng-model = "value" /> & 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} /. Exam ($ Scope.value)} {warning ("invalid number");}}});
You can use the following regex ^ ([0- 9]) Can '1' $ $
Angular Module ('app', []). Controller ('test', function ($ scope) {$ scope.check = function () {If (/ ^ ([0- 9]) \ 1 * $ / test ($ scope.value)) {Warning ("Invalid Number");}}}); View
Comments
Post a Comment