I am trying to write a function that will look for a string (all numeric, 0-9) for a variable sequence of 4 or more repeating characters.
Here are some examples of inputs:
"14888838": the function will return True because it detected "8888".
"1111": the function will return True because it detected "1111".
"1359": the function will return False because 4 duplicate characters were not found in it.
My first inclination is to use re, so I thought that the pattern: "[0-9] {4}" would work, but returns true if it finds four digits in a string, whether they are a match or not.
In any case, in advance for your help.
Dave
source
share