How can I find a repeated pattern in a string?
the input is:
aaaa cacaca abcd aacc cacc
output:
(a)4 (ca)3 none (a)2 none <