I'm trying to find every number where more than two individual digits double. Such as:
- 0000000012
- 1837488809
My code is:
if [[ $number =~ (.)\1{3,10} ]];
then
echo "$number found"
fi
It is working but not as expected: It echo’s out numbers containing on 11, and just them.
What am I doing wrong?
11?, also two double numbers means it should match1122right?(\d)\1{2,}.set -xto your script and see what the[[command is actually seeing.