Try out this:
^(\d)\1*$ or try this ^([0-9])\1*$
please modify the above regex according to your problem.pattern matching if the user enters same digit. \1 matches the first capture group, so the pattern matches whether the digits are repeated in the string.
0
solved Regular Expression to count number of pairs in a string [closed]