Created
May 3, 2012 15:53
-
-
Save davedash/2586745 to your computer and use it in GitHub Desktop.
Match string formatting in python strings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
re.findall(r'(?:\%\([^\)]+\)(?:s|d)|\%(?:s|d)|{[^}]+})', u'Hi %(you)ss there %(yo)s %(num)d' ' Beef %d %s' '{meat} rules {who}') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment