Skip to content

Commit

Permalink
Regex didn't work with multiple reasons
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-daniels committed Oct 31, 2014
1 parent ef2a2aa commit 1aed5cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def checkifspam(data):
return False

def fetch_post_id_and_site_from_msg_content(content):
search_regex = r"^\[ \[SmokeDetector\]\(https:\/\/github.com\/Charcoal-SE\/SmokeDetector\) \] [\w ]+: \[.+]\(http:\/\/[\w.]+\/questions\/(\d+)\/.+\) by \[.+\]\((?:.+)\) on `([\w.]+)`$"
search_regex = r"^\[ \[SmokeDetector\]\(https:\/\/github.com\/Charcoal-SE\/SmokeDetector\) \] [\w\s,]+: \[.+]\(http:\/\/[\w.]+\/questions\/(\d+)\/.+\) by \[.+\]\((?:.+)\) on `([\w.]+)`$"
m = re.compile(search_regex).search(content)
if m is None:
return None
Expand All @@ -189,7 +189,7 @@ def fetch_post_id_and_site_from_msg_content(content):
return None # message is not a report

def fetch_owner_url_from_msg_content(content):
search_regex = "^\[ \[SmokeDetector\]\(https:\/\/github.com\/Charcoal-SE\/SmokeDetector\) \] [\w ]+: \[.+]\(http:\/\/[\w.]+\/questions\/\d+\/.+\) by \[.+\]\((.+)\) on `[\w.]+`$"
search_regex = "^\[ \[SmokeDetector\]\(https:\/\/github.com\/Charcoal-SE\/SmokeDetector\) \] [\w\s,]+: \[.+]\(http:\/\/[\w.]+\/questions\/\d+\/.+\) by \[.+\]\((.+)\) on `[\w.]+`$"
m = re.compile(search_regex).search(content)
if m is None:
return None
Expand Down

0 comments on commit 1aed5cc

Please sign in to comment.