A regex doesn't work
-
@QString str = "[[["123"";
QRegExp rx("[[["([^"]+)"");
rx.indexIn(str,0);
cout << rx.cap(1).toStdString();@
Why it doesn't output 123 in console? -
There is a "regexp example application":http://qt-project.org/doc/qt-5.0/qtwidgets/tools-regexp.html coming with Qt. I found it quite helpful in trying to find regexp issues.
-
Your regular expression is invalid. After the C-string escapes are stripped you get:
@
[[["([^"]+)"
@
when what you were expecting is more like:
@
[[["([^"]+)"
@Try:
@
QRegExp rx("[[["([^"]+)"");
@