Last active
January 12, 2017 16:59
-
-
Save rectalogic/7d421c1b7d7f748be6b97c76561e6ae8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
>>> INDEX_RE = re.compile(r"CREATE( | UNIQUE )INDEX( | CONCURRENTLY)") | |
>>> INDEX_RE.match("CREATE UNIQUE INDEX CONCURRENTLY foo").group(0) | |
'CREATE UNIQUE INDEX ' | |
>>> INDEX_RE.match("CREATE UNIQUE INDEX CONCURRENTLY foo").group(1) | |
' UNIQUE ' | |
>>> INDEX_RE.match("CREATE UNIQUE INDEX CONCURRENTLY foo").group(2) | |
' ' |
This file contains hidden or 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
>>> INDEX_RE = re.compile(r"CREATE(| UNIQUE) INDEX(| CONCURRENTLY) ") | |
>>> INDEX_RE.match("CREATE UNIQUE INDEX CONCURRENTLY foo").group(1) | |
' UNIQUE' | |
>>> INDEX_RE.match("CREATE UNIQUE INDEX CONCURRENTLY foo").group(2) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment