Seems to be an easy question, but I miss something in regex groups I guess. I have a string and I need to find how many occurrences of three patterns it has.
string="AGTGCTGGCCGATATGCNYGGAATATATGCAGTGGTGNTT"
pattern1="GGCCTATATGC"
pattern2="GGAANATATGC"
pattern3="GGCCGATATGC"
The idea is to use regular expressions.
I tried:
re.findall(r"GG[C,A]{2}[A-Z](AT){2}GC", string)
However, I do something wrong in (AT){2}
, because with just writing ATAT
it works. Is it somehow related to groups in regex? Would appreciate if someone can explain.
Thanks,