Port one QRegExp to QRegularExpression
Make the pattern non-greedy to match the behaviour or QRegExp::setMinimal(true).
Don't iterate over the string manually, QString::replace(QRegularExpression) will constructs a QRegularExpressionMatchIterator internally and do that work.