16,213
社区成员
发帖
与我相关
我的任务
分享
QString str = "abcd,efgh,ijklmnop、qrst";
QRegExp regexp("\\b\\w+\\b"); //\b表示符号和字符的边界, \w表示字符
int index = 0;
do
{
index = regexp.indexIn(str, index);
if (index < 0)
break;
//这里输出结果
qDebug() << regexp.cap();
index += regexp.matchedLength();
} while(index >= 0);