import re
text = """Goiânia Vitória Brasília [Campo Grande] Fortaleza [São Paulo] Manaus [Santa Bárbara d'Oeste]"""
regex = re.compile('\[(.*?)\]|(\S+)')
matches = regex.finditer(text)
for match in matches:
if(match.group(1) is None):
print(match.group(2))
else:
print(match.group(1))
aW1wb3J0IHJlCnRleHQgPSAiIiJHb2nDom5pYSBWaXTDs3JpYSBCcmFzw61saWEgW0NhbXBvIEdyYW5kZV0gRm9ydGFsZXphIFtTw6NvIFBhdWxvXSBNYW5hdXMgW1NhbnRhIELDoXJiYXJhIGQnT2VzdGVdIiIiCnJlZ2V4ID0gcmUuY29tcGlsZSgnXFsoLio/KVxdfChcUyspJykKbWF0Y2hlcyA9IHJlZ2V4LmZpbmRpdGVyKHRleHQpCmZvciBtYXRjaCBpbiBtYXRjaGVzOgoJaWYobWF0Y2guZ3JvdXAoMSkgaXMgTm9uZSk6CgkJcHJpbnQobWF0Y2guZ3JvdXAoMikpCgllbHNlOgoJCXByaW50KG1hdGNoLmdyb3VwKDEpKQ==