[Solved] Qt regexp
-
Hi People,
I have a little bit problem with using of QRegExp class. Please consider the following dummy example:
@
QString str = "sadsfsdfg52151";
QRegExp r("^([A-Za-Z]+)([0-9]+)");r.indexIn(str); qDebug() << r.cap(0); qDebug() << r.cap(1); qDebug() << r.cap(2);
@
I hope that those find full string via "cap(0)", the first part of "str" via "cap(1)" and the numbers at end of the string via "cap(2)", but it doesn't print anything. What I made wrong? :(
Can anybody help me, how to write a properly regexp's with Qt?Regards,
Norbert