Skip to content
Browse files

Fix for URL path regex. Now compliant with what Twitter's official li…

…braries support
  • Loading branch information...
1 parent 157316e commit 74003eade0c7ee6eae159f5c4f13c5220d6114c1 @kylemcc kylemcc committed Oct 26, 2011
Showing with 2 additions and 2 deletions.
  1. +2 −2 twitter_text/regex.py
View
4 twitter_text/regex.py
@@ -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
@@ -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.
Something went wrong with that request. Please try again.