diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2020-12-07 01:40:54 +0100 |
---|---|---|
committer | Tarja Sundqvist <tarja.sundqvist@qt.io> | 2021-04-06 16:09:38 +0200 |
commit | 7777521ea6cb7616b343ec0532add43f2b777aaf (patch) | |
tree | a1d3fccc58f8baa576d0fa143257c732be34854b /src/corelib/text/qstring.cpp | |
parent | c936c1fbd73cfe29b44d61f5b9bb09f6b0f0bb0c (diff) | |
download | qtbase-7777521ea6cb7616b343ec0532add43f2b777aaf.tar.gz |
QString: improve lastIndexOf(QRegularExpression) docs
Due to how regex matching works, lastIndexOf has to be implemented
by matching from the string's beginning until the from position
is reached. This might not be obvious for users, so document that.
Task-number: QTBUG-89050
Change-Id: I4b69ea753e7d417d980031926f1e01d77e58720d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 6f2dc8d7f27419d13bfbb2af272af99c03c66562)
Reviewed-by: Paul Wicking <paul.wicking@qt.io>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r-- | src/corelib/text/qstring.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp index 9a6f3226f6..a133f98a17 100644 --- a/src/corelib/text/qstring.cpp +++ b/src/corelib/text/qstring.cpp @@ -4550,6 +4550,10 @@ int QString::lastIndexOf(const QRegularExpression &re, int from) const Example: \snippet qstring/main.cpp 100 + + \note Due to how the regular expression matching algorithm works, + this function will actually match repeatedly from the beginning of + the string until the position \a from is reached. */ int QString::lastIndexOf(const QRegularExpression &re, int from, QRegularExpressionMatch *rmatch) const { |