Skip to content
This repository has been archived by the owner on Apr 4, 2018. It is now read-only.

Commit

Permalink
Fix for URL path regex. Now compliant with what Twitter's official li…
Browse files Browse the repository at this point in the history
…braries support
  • Loading branch information
kylemcc committed Oct 26, 2011
1 parent 157316e commit 74003ea
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions twitter_text/regex.py
Expand Up @@ -38,7 +38,7 @@
REGEXEN['valid_preceding_chars'] = re.compile(ur"(?:[^\/\"':!=]|^|\:)")
punct = re.escape(string.punctuation)
REGEXEN['valid_domain'] = re.compile(ur'(?:[^%s\s][\.-](?=[^%s\s])|[^%s\s]){1,}\.[a-z]{2,}(?::[0-9]+)?' % (punct, punct, punct), re.IGNORECASE)
REGEXEN['valid_url_path_chars'] = re.compile(ur'[\.\,]?[a-z0-9!\*\'\(\);:=\+\$\/%#\[\]\-_,~@]', re.IGNORECASE)
REGEXEN['valid_url_path_chars'] = re.compile(ur'[\.\,]?[a-z0-9!\*\'\(\);:=\+\$\/%#\[\]\-_,~@\.]', re.IGNORECASE)
# Valid end-of-path chracters (so /foo. does not gobble the period).
# 1. Allow ) for Wikipedia URLs.
# 2. Allow =&# for empty URL parameters and other URL-join artifacts
Expand Down Expand Up @@ -68,4 +68,4 @@
# 3 - Protocol or www.
# 4 - Domain and optional port number
# 5 - URL path
# 6 - Query string
# 6 - Query string

0 comments on commit 74003ea

Please sign in to comment.