Last active
February 9, 2017 22:30
-
-
Save orsenthil/19dacdaec1ee0e3206159f98e0db5bdb to your computer and use it in GitHub Desktop.
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 | |
RE_PATTERNS = re.compile(r"(?:Issue ?)?#?(\d+)", flags=re.MULTILINE | re.IGNORECASE) | |
test_messages = [ | |
"""#123""", | |
"""Issue #123""", | |
"""Issue#123""", | |
"""Issue123""", | |
"""Issue 123""", | |
"""Multiline | |
#1234 | |
Issue1134""", | |
"""Multiline | |
Issue1234, | |
#12345, | |
Issue 12345""" | |
] | |
for message in test_messages: | |
print RE_PATTERNS.sub(r"bpo-\1", message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment