Project

General

Profile

0001-change-highlight-regexp-boundaries-from-b-to-W.patch

dalbers, 08/13/2009 12:49 AM

View differences:

src/qtui/qtuimessageprocessor.cpp
119 119
        nickList.prepend(net->myNick());
120 120
    }
121 121
    foreach(QString nickname, nickList) {
122
      QRegExp nickRegExp("\\b" + QRegExp::escape(nickname) + "(\\W|\\b|$)", // + "\\b", this does not seem to work for trailing ` -> upstream bug?
123
                          _nicksCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
122
      qDebug() << nickname << QRegExp::escape(nickname);
123
      QRegExp nickRegExp("(^|\\W)" + QRegExp::escape(nickname) + "(\\W|$)", _nicksCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive);
124
      qDebug() << nickRegExp;
124 125
      if(nickRegExp.indexIn(msg.contents()) >= 0) {
125 126
        msg.setFlags(msg.flags() | Message::Highlight);
126 127
        return;
......
137 138
        QRegExp rx(rule.name, rule.caseSensitive? Qt::CaseSensitive : Qt::CaseInsensitive);
138 139
        match = rx.exactMatch(msg.contents());
139 140
      } else {
140
        QRegExp rx("\\b" + QRegExp::escape(rule.name) + "\\b", rule.caseSensitive? Qt::CaseSensitive : Qt::CaseInsensitive);
141
        QRegExp rx("\\W" + QRegExp::escape(rule.name) + "\\W", rule.caseSensitive? Qt::CaseSensitive : Qt::CaseInsensitive);
141 142
        match = (rx.indexIn(msg.contents()) >= 0);
142 143
      }
143 144
      if(match) {
144
-