QString str = QString::fromLocal8Bit("adsfasdf18012341234asdf13063083333asdfasf"); QRegExp rx("1\\d{10}"); // int pos = 0; while ((pos = rx.indexIn(str,pos)) != -1) { qDebug()<<rx.cap(0); pos += rx.matchedLength(); }
QString str = QString::fromLocal8Bit("adsfasdf18012341234asdf13063083333asdfasf"); QRegExp rx("1\\d{10}"); // int pos = 0; while ((pos = rx.indexIn(str,pos)) != -1) { qDebug()<<rx.cap(0); pos += rx.matchedLength(); }