import re
s = "AAANAANABNA"
pattern = r"(?<!A)(?=(A+N+A+))"
print(re.findall(pattern, s))