0
Wie kann ich die erste Saite ("firstStr"
für die Beispiele unten) erhalten mit QRegularExpressionerste Saite mit QRegularExpression
QString readCmdOutput = "";
/* readCmdOutput = "firstStr\secondStr"; or
readCmdOutput = "firstStr
secondStr
"
*/
readCmdOutput = QString::fromLocal8Bit(myProcess->readAllStandardOutput());
QRegularExpression re("REGEXPRESSION");
QRegularExpressionMatch match = re.match(readCmdOutput);
if (match.hasMatch()) {
QString matched2 = match2.captured(0); // has to contain "firstStr"
}