FYI, there is a “parse” library on PyPI:

Parse strings using a specification based on the Python format() syntax.
parse() is the opposite of format()
(I haven’t used it myself, but I find the idea compelling, specially for people unfamiliar with regexes or C-style printf syntax).


Stefane Fermigier - - -
Founder & CEO, Abilian - Enterprise Social Software -
Co-Founder & Co-Chairman, National Council for Free & Open Source Software (CNLL) -
Co-Founder & Chairman, Association Professionnelle Européenne du Logiciel Libre (APELL) -
Co-Founder & Spokesperson, European Cloud Industrial Alliance (EUCLIDIA) - 
Founder, PyParis & PyData Paris -