test: migrate QXmlSimpleReader to QRegularExpression

This is part of the migration of qtbase from QRexExp to
QRegularExpression.

Task-number: QTBUG-72587
Change-Id: Ifa62ad002689a0be6ed1a88ad4ac0e92082ef616
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
Samuel Gaist 2019-06-10 10:03:31 +02:00
parent 6ff2e0e718
commit 605dc42a0f

View File

@ -28,7 +28,7 @@
#include <qxml.h>
#include <qregexp.h>
#include <qregularexpression.h>
#include "parser.h"
@ -139,11 +139,11 @@ bool ContentHandler::startElement(const QString &namespaceURI,
QString ContentHandler::escapeStr(const QString &s)
{
QString result = s;
result.replace(QRegExp("\""), "\\\"");
result.replace(QRegExp("\\"), "\\\\");
result.replace(QRegExp("\n"), "\\n");
result.replace(QRegExp("\r"), "\\r");
result.replace(QRegExp("\t"), "\\t");
result.replace(QRegularExpression("\""), "\\\"");
result.replace(QRegularExpression("\\"), "\\\\");
result.replace(QRegularExpression("\n"), "\\n");
result.replace(QRegularExpression("\r"), "\\r");
result.replace(QRegularExpression("\t"), "\\t");
return result;
}