[erlehmann] Improved regular URL matching expressions. Fixes #3715.
URLs like (http://myFoobar.org) and http://en.wikipedia.org/wiki/Mornington_Crescent_(game) are now correctly detected.
This commit is contained in:
parent
766decde58
commit
59b9e86fbb
|
@ -2271,7 +2271,9 @@ class Interface:
|
|||
|
||||
#FIXME: recognize xmpp: and treat it specially
|
||||
|
||||
links = r"(www\.(?!\.)|[a-z][a-z0-9+.-]*://)[^\s<>'\"]+[^!,\.\s<>\)'\"\]]"
|
||||
links = r"((?<=\()[A-Za-z][A-Za-z0-9+.-]*:"\
|
||||
r"([A-Za-z0-9+\.-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[A-Fa-f0-9]{2})+"\
|
||||
r"(?=\)))|([A-Za-z][A-Za-z0-9+.-]*:([A-Za-z0-9+\.-_~:/\?#\[\]@!\$&'\(\)\*\+,;=]|%[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]'
|
||||
|
||||
|
|
Loading…
Reference in New Issue