Created
November 9, 2012 11:22
-
-
Save tangentstorm/4045219 to your computer and use it in GitHub Desktop.
imap regexp example for timg
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
>>> import re | |
>>> data = ['2 (X-GM-THRID 1391221299548167514 X-GM-MSGID 1391221299548167514 UID 6)'] | |
>>> re.search('X-GM-THRID (?P<X_GM_THRID>\d+) X-GM-MSGID (?P<X_GM_MSGID>\d+)', data[0]).groupdict() | |
{'X_GM_THRID': '1391221299548167514', 'X_GM_MSGID': '1391221299548167514'} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment