Why is the regular expression of Qt a little different? I can match correctly in regular matching software, but not in Qt. For example.
QString tstring = "scale(1.1) rotate(180) translate(1,0)";
QRegExp re("(?<=[\\)]).");
QStringList tlist = tstring.split(re);
I want to separate the three with spaces to get the three QString "scale(1.1)", "rotate(180)" "translate(1,0)"
Different syntaxes of regular expressions exist. Qt implements some of them:
QRegularExpression(>= Qt5): implements Perl-compatible regular expressionsQRegExp: implements multiple regular expression forms, seeQRegExp::PatternSyntaxQRegExp::RegExp(the default): Qt's regexp language modeled on Perl's regexp languageQRegExp::Wildcard: similar to wildcards used by shells.QRegExp::W3CXmlSchema11: implementation of the W3C XML Schema 1.1 specification.Note that
QRegularExpressionis the recommended one:A detailed overview of the differences between
QRegExpandQRegularExpressioncan be found in the docs.