I've to split simple QStrings of the form "number number number",for example " 2323 432 1223". The code i use is
QString line;
QRegularExpression re("(\\d+)");
QRegularExpressionMatch match;
while(!qtextstream.atEnd()){
line = qtextstream.readLine();
match = re.match(line);
std::cout<<"1= "<<match.captured(0).toUtf8().constData()<<std::endl;
std::cout<<"2= "<<match.captured(1).toUtf8().constData()<<std::endl;
std::cout<<"3= "<<match.captured(2).toUtf8().constData()<<std::endl;
}
if the first line being processed is like the example string i get for the first while cycle output:
1= 2323
2= 2323
3=
what is wrong?