For (...?)\1* the pattern matching is greedy, which will always accept strings of the form ABCABCABCABC, but fail to match strings like ABABABABABAB
This is because for ? it tries to match maximum number of letters possible (ABA). And then the rest of regex doesn't work anymore. Instead. ? should probably iterate through both options and return True if either is True.
For
(...?)\1*
the pattern matching is greedy, which will always accept strings of the form ABCABCABCABC, but fail to match strings like ABABABABABABThis is because for ? it tries to match maximum number of letters possible (ABA). And then the rest of regex doesn't work anymore. Instead. ? should probably iterate through both options and return True if either is True.