From: Daniel Albers Date: Sun, 31 Jan 2010 14:34:39 +0000 (+0100) Subject: tweak URL regex X-Git-Tag: 0.6-beta1~54 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=6b43b39928a36f8c7f497a7f9c2de0133e142bd8 tweak URL regex We still allow some of the characters flagged "unwise" in RFC 2396 Fixes #860 Fixes #876 --- diff --git a/src/uisupport/clickable.cpp b/src/uisupport/clickable.cpp index df2d3dc4..e875bad1 100644 --- a/src/uisupport/clickable.cpp +++ b/src/uisupport/clickable.cpp @@ -51,8 +51,8 @@ void Clickable::activate(NetworkId networkId, const QString &text) const { ClickableList ClickableList::fromString(const QString &str) { // For matching URLs static QString scheme("(?:(?:mailto:|(?:[+.-]?\\w)+://)|www(?=\\.\\S+\\.))"); - static QString authority("(?:[,.;@:-]?\\w+)+(?::\\d+)?"); - static QString urlChars("(?:[,.;:\\w~@/?&=+$()!%#*{}\\[\\]'^-])"); + static QString authority("(?:[,.;@:]?[-\\w]+)+(?::\\d+)?"); + static QString urlChars("(?:[,.;:]*[\\w~@/?&=+$()!%#*{}\\[\\]\\|'^-])"); static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)"); static QRegExp regExp[] = {