import re
print (re.subn("(a)(n)", r"\2\1", "banana"))