RFC Compliant URL Matching

Implemented https://gist.github.com/dperini/729294 in Chatterino 2.

This makes URL Validation / Matching RFC compliant.
This commit is contained in:
Lajamerr Mittesdine 2018-06-05 03:35:54 -04:00 committed by GitHub
parent e6ddfa4903
commit 64461161ec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -46,7 +46,7 @@ QString MessageBuilder::matchLink(const QString &string)
{ {
const QString urlRegExp = "^" const QString urlRegExp = "^"
// protocol identifier // protocol identifier
"(?:(?:https?|ftp)://)" "(?:(?:https?|ftp)://)?"
// user:pass authentication // user:pass authentication
"(?:\\S+(?::\\S*)?@)?" "(?:\\S+(?::\\S*)?@)?"
"(?:" "(?:"