import re
p = re.compile(r'ATG(?:...)*?(?:TAG|TGA|TAA)')
test_str = "FFG FFG ATGCCCTAG"
print (p.findall(test_str))