diff options
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 3c08d970ed..bac6d20c0c 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -4562,13 +4562,13 @@ int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpress return -1; } - int endpos = (from < 0) ? (size() + from + 1) : (from); + int endpos = (from < 0) ? (size() + from + 1) : (from + 1); QRegularExpressionMatchIterator iterator = re.globalMatch(*this); int lastIndex = -1; while (iterator.hasNext()) { QRegularExpressionMatch match = iterator.next(); int start = match.capturedStart(); - if (start <= endpos) { + if (start < endpos) { lastIndex = start; if (rmatch) *rmatch = std::move(match); |