diff options
-rw-r--r-- | src/corelib/doc/snippets/qstring/main.cpp | 4 | ||||
-rw-r--r-- | src/corelib/tools/qstring.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/corelib/doc/snippets/qstring/main.cpp b/src/corelib/doc/snippets/qstring/main.cpp index 5871026f95..41ee5a9cef 100644 --- a/src/corelib/doc/snippets/qstring/main.cpp +++ b/src/corelib/doc/snippets/qstring/main.cpp @@ -380,14 +380,14 @@ void Widget::fillFunction() void Widget::fromRawDataFunction() { //! [22] - QRegExp pattern; + QRegularExpression pattern("\u00A4"); static const QChar unicode[] = { 0x005A, 0x007F, 0x00A4, 0x0060, 0x1009, 0x0020, 0x0020}; int size = sizeof(unicode) / sizeof(QChar); QString str = QString::fromRawData(unicode, size); - if (str.contains(QRegExp(pattern))) { + if (str.contains(pattern) { // ... //! [22] //! [23] } diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp index 8888eced87..9a3c05ac85 100644 --- a/src/corelib/tools/qstring.cpp +++ b/src/corelib/tools/qstring.cpp @@ -8144,7 +8144,7 @@ bool QString::isRightToLeft() const to create a deep copy of the data, ensuring that the raw data isn't modified. - Here's an example of how we can use a QRegExp on raw data in + Here's an example of how we can use a QRegularExpression on raw data in memory without requiring to copy the data into a QString: \snippet qstring/main.cpp 22 |