I have a string like
aaabbbbcca
And I'd like to parse all possible uniform substrings from that. So my expected substrings for this string are
['a', 'aa', 'aaa', 'b', 'bb', 'bbb', 'bbbb', 'c', 'cc', 'a']
I tried the following
import re
print(re.findall(r"([a-z])(?=\1*)", "aaabbbbcca"))
# Output: ['a', 'a', 'a', 'b', 'b', 'b', 'b', 'c', 'c', 'a']
Is it possible trough regular expressions? If yes, then how?