Improving URL detection regexp
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 20 Oct 2008 06:11:54 +0000 (08:11 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 20 Oct 2008 06:11:54 +0000 (08:11 +0200)
src/qtui/chatitem.cpp

index 5d520e8..6f1c50c 100644 (file)
@@ -309,7 +309,7 @@ void ContentsChatItem::doLayout() {
 QList<ContentsChatItem::Clickable> ContentsChatItem::findClickables() const {
   // For matching URLs
   static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)");
 QList<ContentsChatItem::Clickable> ContentsChatItem::findClickables() const {
   // For matching URLs
   static QString urlEnd("(?:>|[,.;:\"]*\\s|\\b|$)");
-  static QString urlChars("(?:[\\w\\-~@/?&=+$()!%#]|[,.;:]\\w)");
+  static QString urlChars("(?:[,.;:]*[\\w\\-~@/?&=+$()!%#])");
 
   static QRegExp regExp[] = {
     // URL
 
   static QRegExp regExp[] = {
     // URL