我的正则表达式怎么了?根据计划,应该有两个要素,但仅定义第一个要素。 Qt5.12 MinGW32 Windows 7x86。
QRegExp rx("\\d+");
QString buf_last;
buf_last.append("read0_1");
rx.indexIn(buf_last);
auto try_step = rx.cap(0).toInt();
auto current_step = rx.cap(1).toInt();
qDebug() << try_step << current_step << buf_last << "rx___" << rx.cap(0)
<< rx.cap(1) << rx.capturedTexts();