^.?$|^(..+?)\1+$
<answer>
Matches strings of any character repeated a non-prime number of times
You must log in or register to comment.
\1 is group 1 which is inside
()
, so second part is repeated 2 or more times of 2 or more char.Interesting.
So that means match any string that is made entirely of a single repeating sequence, where repititon is possible.