I need to determine if a string is composed of a certain repeating character, for example eeeee
, 55555
, or !!!
.
I know this regex 'e{1,15}'
can match eeeee
but it obviously can't match 555
. I tried [a-z0-9]{1-15}
but it matches even the strings I don't need like Hello
.
The solution doesn't have to be regex. I just can't think of any other way to do this.