I have a long string of the following form:
joined_string = "ASOGHFFFFFFFFFFFFFFFFFFFGFIOSGFFFFFFFFURHDHREEKFFFFFFIIIEI..."
it is a concatenation of random strings interspersed by strings of consecutive F
letters:
ASOGH
FFFFFFFFFFFFFFFFFFF
GFIOSG
FFFFFFFF
URHDHREEK
FFFFFF
IIIEI
The number of consecutive F
letters is not fixed, but there will be more than 5,
and lets assume five F
letters will not appear in random strings consecutively.
I want to extract only random strings to get the following list:
random_strings = ['ASOGH', 'GFIOSG', 'URHDHREEK', 'IIIEI']
I imagine there is a simple regex expression that would solve this task:
random_strings = joined_string.split('WHAT_TO_TYPE_HERE?')
Question: how to code a regex pattern for multiple identical characters?