tags:

views:

19

answers:

1

I'm receiving messages from a socket and writing an html log of it. I need to search the messages for any kind of urls and retrieve the list and also to replace it with foo.

A: 

Find one of many regular expressions for a URL and use QString::replace (the regex overload).

QString s;
QRegExp regexp(...);
s.replace(regexp, "foo");
Idan K