在QString中可能有多个E-mail地址 我要怎么才能把他们都获得呢??
我现在尝试过的一些:
QString str="my name is bob,bobis good boy,i lick bob<";
QRegExp reg("bob");
reg.indexIn(str);
qDebug() << str.count(reg); // output: 3 OK
reg.indexIn(str);
reg.cap(0); // output: "bob" OK
reg.cap(1); // output: "" why
reg.cap(2); // output: "" why
-------------------------------------------------------
QString str="my name is bob,bobis good boy,i lick bob<";
QRegExp reg("bob");
reg.indexIn(str);
QStringList list=reg.capturedTexts();
qDebug() << list.count(); // output : 1
[ 此贴被XChinux在2008-07-18 16:48重新编辑 ]