fork download
  1. import re
  2.  
  3. pattern = r"(?<!g)(?=(g{3,}(?:[atc](?:g{0,2}[atc])*g{3,}){3}))"
  4. s = ("ggggggcgggggggACGCTCggctcAAGGGCTCCGGGCCCCgggggggACgcgcgAAGGGCTCC \n")
  5. print(re.findall(pattern, s, re.I))
Success #stdin #stdout 0.03s 9616KB
stdin
Standard input is empty
stdout
['ggggggcgggggggACGCTCggctcAAGGGCTCCGGG', 'gggggggACGCTCggctcAAGGGCTCCGGGCCCCggggggg', 'GGGCTCCGGGCCCCgggggggACgcgcgAAGGG']