OSDN Git Service

Fix url validator with using regex. master
authorTaizo ITO <taizo@karesansui-project.info>
Wed, 16 Mar 2011 06:05:52 +0000 (15:05 +0900)
committerTaizo ITO <taizo@karesansui-project.info>
Wed, 16 Mar 2011 06:05:52 +0000 (15:05 +0900)
karesansui/lib/checker.py

index b6c60d7..55380a3 100644 (file)
@@ -1227,7 +1227,7 @@ class Checker(object):
             _file_flag = False
             if check & CHECK_VALID:
 
-                regex = '^(http|ftp):\/\/[\w.]+\/(\S*)'
+                regex = '^(http|ftp):\/\/[\w.\-]+\/(\S*)'
                 m = re.compile(regex).search(value)
                 if m:
                     _http_flag = True