mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
RFC Compliant URL Matching
Implemented https://gist.github.com/dperini/729294 in C++ This makes URL Validation / Matching RFC compliant.
This commit is contained in:
parent
ad4cdfc66d
commit
e6ddfa4903
1 changed files with 1 additions and 1 deletions
|
@ -65,7 +65,7 @@ QString MessageBuilder::matchLink(const QString &string)
|
||||||
"(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))"
|
"(?:\\.(?:[1-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))"
|
||||||
"|"
|
"|"
|
||||||
// host name
|
// host name
|
||||||
"(?:(?:[a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)"
|
"(?:(?:[_a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)"
|
||||||
// domain name
|
// domain name
|
||||||
"(?:\\.(?:[a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)*"
|
"(?:\\.(?:[a-z\\x{00a1}-\\x{ffff}0-9]-*)*[a-z\\x{00a1}-\\x{ffff}0-9]+)*"
|
||||||
// TLD identifier
|
// TLD identifier
|
||||||
|
|
Loading…
Reference in a new issue