regex works very slow
问题 I have lots of files less than 64 kb and I need to convert them with code below. Here is working code in QT with QRegExp . I tried to rewrite it in MSVC with regex_replace and faced with the problem of very slow work. QT: temp.replace(QRegExp("[ ]{0,}(=)[ ]{0,}"), QString("=")); temp.replace(QRegExp("[ ]{0,}(==)[ ]{0,}"), QString("==")); temp.replace(QRegExp("[ ]{0,}(>)[ ]{0,}"), QString(">")); temp.replace(QRegExp("[ ]{0,}(<)[ ]{0,}"), QString("<")); temp.replace(QRegExp("[ ]{0,}(\\&\\&)[ ]