Fix QRegularExpression* docs
A couple of runaway backslashes resulted in illegal code in the examples. Change-Id: Ib00d4e1d792e44bb73dafdd84c3a1843dcb34e27 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
This commit is contained in:
parent
946317711f
commit
4bf55f979f
@ -267,7 +267,7 @@ for (int i = 0; i <= match.lastCapturedIndex(); ++i) {
|
||||
//! [28]
|
||||
|
||||
//! [29]
|
||||
QRegularExpression("(\d\d) (?<name>\w+)");
|
||||
QRegularExpression("(\\d\\d) (?<name>\\w+)");
|
||||
QRegularExpressionMatch match = re.match("23 Jordan");
|
||||
if (match.hasMatch()) {
|
||||
QString number = match.captured(1); // first == "23"
|
||||
@ -277,7 +277,7 @@ if (match.hasMatch()) {
|
||||
|
||||
//! [30]
|
||||
// extracts the words
|
||||
QRegularExpression re("(\w+)");
|
||||
QRegularExpression re("(\\w+)");
|
||||
QString subject("the quick fox");
|
||||
QRegularExpressionMatchIterator i = re.globalMatch(subject);
|
||||
while (i.hasNext()) {
|
||||
|
Loading…
Reference in New Issue
Block a user