A personal blog of Christopher Wigginton; a nerd by nature, programming polyglot, cooking enthusiast and fermentation practitioner.
import re print( re.sub(r'(foo)(bar)',r'\g<2>\g<1>','foobar'))