Qt

Aus Info-Theke
Zur Navigation springen Zur Suche springen


RegExpr

QRegularExpression regExpr("(\\d+)x(\\d+)");
QRegularExpressionMatch match = regExpr.match(line);
if (match.hasMatch()){
   QString width = match.captured(1);
   QString height = match.captured(2);
}

QRegularExpression re("(\\w+)");
QRegularExpressionMatchIterator i = re.globalMatch(line);
while(i.hasNext()){
   QRegularExpressionMatch match = i.next();
   QString word = match.captured(1);
}