Tweaked the RE for detecting URLs again

This commit is contained in:
Alexander Cherniuk 2010-08-11 01:35:06 +03:00
parent 35bbbfe55c
commit 39f96a92be
1 changed files with 1 additions and 2 deletions

View File

@ -2432,8 +2432,7 @@ class Interface:
# FIXME: recognize xmpp: and treat it specially
links = r"((?<=\()[A-Za-z][A-Za-z0-9\+\.\-]*:"\
r"([\w\.\-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+"\
r"(?=\)))|([A-Za-z][A-Za-z0-9\+\.\-]*:([\w\.\-_~:/\?#\[\]@!\$"\
r"&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+)"
r"(?=\)))|(\w[\w\+\.\-]*:([^<>\s]|%[A-Fa-f0-9]{2})+)"
# 2nd one: at_least_one_char@at_least_one_char.at_least_one_char
mail = r'\bmailto:\S*[^\s\W]|' r'\b\S+@\S+\.\S*[^\s\W]'