Add QRegularExpression::CaseInsensitiveOption

This commit is contained in:
Jonas Kvinge
2021-08-13 23:33:41 +02:00
parent 1ebfa0ad7e
commit cecb9293f6
5 changed files with 8 additions and 9 deletions

View File

@@ -49,10 +49,9 @@ SongList ASXParser::Load(QIODevice *device, const QString &playlist_path, const
QByteArray data = device->readAll();
// Some playlists have unescaped & characters in URLs :(
QRegularExpression ex("(href\\s*=\\s*\")([^\"]+)\"");
QRegularExpressionMatch re_match;
QRegularExpression ex("(href\\s*=\\s*\")([^\"]+)\"", QRegularExpression::CaseInsensitiveOption);
int index = 0;
for (re_match = ex.match(data, index) ; re_match.hasMatch() ; re_match = ex.match(data, index)) {
for (QRegularExpressionMatch re_match = ex.match(data, index) ; re_match.hasMatch() ; re_match = ex.match(data, index)) {
index = re_match.capturedStart();
QString url = re_match.captured(2);
url.replace(QRegularExpression("&(?!amp;|quot;|apos;|lt;|gt;)"), "&");