QRegExp rx("(\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3})");
QString text("192.168.1.1 blah-blah 192.168.1.2 blah-blah");
int pos = 0;
QStringList list;
while ((pos = rx.indexIn(text, pos)) != -1)
{
list << rx.cap(1);
pos += rx.matchedLength();
}
192.168.1.1
192.168.1.2
QRegExp rx("(((?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))");