Created
July 17, 2013 21:09
-
-
Save ivanelson/6024526 to your computer and use it in GitHub Desktop.
Regex for mail reply
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
found_id = None | |
if self.parameters.ticket_update and self.parameters.ticket_update_by_subject: | |
SUBJECT_RE = re.compile(r'^(?:(?:RE|AW|VS|SV|FW|FWD):\s*)+(.*)', re.IGNORECASE) | |
result = SUBJECT_RE.search(subject) | |
LOG = open("/tmp/regex.log", "a") | |
LOG.write("<<INICIO>>\n") | |
LOG.write("INICIO UPDATE_BY_SUBJECT: %s -> %s\n" % (subject.encode('utf8'), result)) | |
LOG.close() | |
if result: | |
## This is a reply | |
# | |
orig_subject = result.group(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment