Improve URL matching regexp, match based on invalid characters

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=724666
wilder-portage
Hoàng Đức Hiếu 19 years ago
parent 37a7ecb434
commit 6c42600828
  1. 4
      src/Filter.cpp

@ -487,8 +487,8 @@ void UrlFilter::HotSpot::activate(QObject* object)
//regexp matches:
// full url:
// protocolname:// or www. followed by numbers, letters dots and dashes or the '@' character.
const QRegExp UrlFilter::FullUrlRegExp("([a-z]+://|www\\.)[^\\s]+");
// protocolname:// or www. followed by anything other than whitespaces, >, ' or ", and ends before whitespaces, >, ), ', ", ] and . (dot)
const QRegExp UrlFilter::FullUrlRegExp("(www\\.(?!\\.)|[a-z][a-z0-9+.-]*://)[^\\s>'\"]+[^\\.\\s>\\)'\"\\]]");
// email address:
// [word chars, dots or dashes]@[word chars, dots or dashes].[word chars]
const QRegExp UrlFilter::EmailAddressRegExp("(\\w|\\.|-)+@(\\w|\\.|-)+\\.\\w+");

Loading…
Cancel
Save