I am using regular expression to search for some string fit for my restrictions. For example, “HHHHLLLHHHHHLLLLL“, I want to find the strings that letter H‘s total occurence is more than 8.
I tried to construct a regular expression using {8,} to search for occurence of H equal or more than 8. However, it doesn’t seem to work.
Str1 = '"HHHHLLLHHHHHLLLLL"'
m = re.search(r'regex', Str1).group(0)
Could anyone give me some suggestion? Thanks.
No need to use regex.