One small note, you are wasting CPU cycle here. The QRegularExpressionMatchIterator returns only match objects that contains a match thus the if is useless.