summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qstring.cpp
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-12-07 01:40:54 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-12-09 03:02:05 +0100
commit6f2dc8d7f27419d13bfbb2af272af99c03c66562 (patch)
tree35f7f9cb79611a5aeff1c81e6173b962337a65c4 /src/corelib/text/qstring.cpp
parent35d62b6852c836eb3cd9f7d5f5b9412b08823288 (diff)
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 Pick-to: 5.15 6.0 Change-Id: I4b69ea753e7d417d980031926f1e01d77e58720d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/text/qstring.cpp')
-rw-r--r--src/corelib/text/qstring.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/text/qstring.cpp b/src/corelib/text/qstring.cpp
index af7bc039fd..56d9e0a011 100644
--- a/src/corelib/text/qstring.cpp
+++ b/src/corelib/text/qstring.cpp
@@ -4261,6 +4261,10 @@ qsizetype QString::indexOf(const QRegularExpression &re, qsizetype from, QRegula
Example:
\snippet qstring/main.cpp 94
+
+ \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.
*/
qsizetype QString::lastIndexOf(const QRegularExpression &re, qsizetype from, QRegularExpressionMatch *rmatch) const
{