3 ms·Regexpr is confused with "+?" so ^.?$|^(..*)\1+$ is better.by timonoko 2y agoRegexpr is confused with "+?" so ^.?$|^(..*)\1+$ is better.