-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Ladislav Michnovi? wrote: > Hello. > Well your last patch is not good enough. I tried it and some URLs are > truncated. E.g. > http://www.google.com/search?hs=zLp&hl=sk&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&q=Alexander+L.+Roshal+email&btnG=H%C4%BEada%C5%A5&lr= > is truncated at first %. Maybe there are some more characters that can > break your regexp.
ok. I looked at rfc 1738. there the url is denfined. In this rfc some groups of characters are explained. - - alphanumeric - - unsafe characters: <>"#%{}|\^~[]` space - - reserved characters: ;/?:@=& - - special characters: $-_.+!*'(), All these characters can be part of an url. I now include all these characters except: <>" space Please try the patch now. > In URL can be , : ). Specially when :) is in URL it is interpreted as > emoticon and it is ommited in the URL when copy&paste or clicking. But > this issue is not your fault, it was already in licq. > I would like to address this problem in another patch. regards rsLeo -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org iD8DBQFEKZGouFcJvHsEu9gRAgzXAJ910zN3zN89+zSFJfcn0d6SYS0EXACeOOUh CanVg2BJnV0zdtXInQQWdkk= =6kWO -----END PGP SIGNATURE-----
--- old/mlview3.cpp 2006-03-28 21:38:05.461445592 +0200 +++ new/mlview3.cpp 2006-03-28 21:36:54.910171016 +0200 @@ -92,8 +92,9 @@ int pos = 0; if (highlightURLs && (pos = text.find(reAHREF, pos)) == -1) { - QRegExp reURL("(\\b|^)(\\w+://\\S+)(\\s|$|\\n)"); - reURL.setMinimal(true); + QRegExp reURL("(\\b|^)((https?|ftp)://([-a-z0-9]+(:[-a-z0-9]+)?@)?[-a-z0-9.]+[-a-z0-9](:[0-9]+)?(/([-a-z0-9%{}|\\\\^~`;/?:@=&$_.+!*'(),]|\\[|\\])*)?)"); + reURL.setMinimal(false); + reURL.setCaseSensitive(false); pos = 0; while ( (pos = text.find(reURL, pos)) != -1 ) { QString url = reURL.cap(2);