Commits

david_walker  committed 35d5838

fix URL-detecting regex and its flags

  • Participants
  • Parent commits 009a777

Comments (0)

Files changed (1)

File classifier.py

     etc. (The term class is not used in a Pythonic sense here.)
     """
     url_re = re.compile(
-        """(\w+\.)+  # one or more dot-delimited words
-           (\w+){2,} # a TLD of at least two characters
-           (\S*)     # any amount of non-space chars """)
+        """(\w+\.)+     # one or more dot-delimited words
+           # one of the TLDs that appear in Kiva loans
+           (com|edu|gov|info|mil|net|org|tj)
+           (\S*)        # any amount of non-space chars """,
+        re.I | re.U | re.VERBOSE)
 
     has_digits_re = re.compile(ur'.*\d+.*')