summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-01-15 21:04:17 +0100
committerGiuseppe D'Angelo <giuseppe.dangelo@kdab.com>2020-01-15 22:59:00 +0100
commit9f1948f59b916966ea0ecdf9c7d3473f7685e08e (patch)
treeda06518510fc07c756cd6d7a3c6dc855a79be3ed
parent7a59d6f138ff8799170cc03d709525ab965d703a (diff)
QRegularExpression: fixup docs of wildcardToRegularExpression
Fix a couple of typos, and add a paragraph explaining that there is no need of anchor the pattern again; a wildcard is always anchored. Fixes: QTBUG-81396 Change-Id: Ia67dc7477a05a450bdcc3def1ebbacce2006da4d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r--src/corelib/text/qregularexpression.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/text/qregularexpression.cpp b/src/corelib/text/qregularexpression.cpp
index 67be67c243..59d21e0a23 100644
--- a/src/corelib/text/qregularexpression.cpp
+++ b/src/corelib/text/qregularexpression.cpp
@@ -1892,6 +1892,10 @@ QString QRegularExpression::escape(const QString &str)
\snippet code/src_corelib_tools_qregularexpression.cpp 31
+ The returned regular expression is already fully anchored. In other
+ words, there is no need of calling anchoredPattern() again on the
+ result.
+
\warning Unlike QRegExp, this implementation follows closely the definition
of wildcard for glob patterns:
\table
@@ -1918,12 +1922,12 @@ QString QRegularExpression::escape(const QString &str)
\note The backslash (\\) character is \e not an escape char in this context.
In order to match one of the special characters, place it in square brackets
- (for example, "[?]").
+ (for example, \c{[?]}).
More information about the implementation can be found in:
\list
\li \l {https://en.wikipedia.org/wiki/Glob_(programming)} {The Wikipedia Glob article}
- \li \c man 7 glob
+ \li \c {man 7 glob}
\endlist
\sa escape()