Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.7.4
-
None
-
kubuntu 11.10 gcc-4.6.1 (Ubuntu/Linaro 4.6.1-9ubuntu3)
-
I9c239ff790a139c7820ef1aeced89d31320ae6b0
Description
http://doc.qt.nokia.com/4.7/qstring.html#contains-6
bool QString::contains ( QRegExp & rx ) const
If there is a match, the rx regular expression will contain the matched captures (see QRegExp::matchedLength, QRegExp::cap).
int QRegExp::matchedLength () const
Returns the length of the last matched string, or -1 if there was no match.
RX.cpp
QString string("abcd"); QRegExp rx("[bc]"); qDebug() << string.contains(rx) << rx.cap(0) << rx.matchedLength(); /** true "" Программа неожиданно завершилась. // (CRASH) */
"contains()" return true, so I thought "cap()" should return captured text, but...
and I got crash when I try to invoke "matchedLength()"
Tnx.