Details
-
Bug
-
Resolution: Invalid
-
Not Evaluated
-
None
-
5.15.0
-
None
Description
QRegularExpression fails to match a simple string with numerous captures and is very slow.
QString s = "7.000000;34311.000000;-63.000000;-11075.438477;81.914001;-1950.119019;-2614.415283;30.500000;4.210000;0.000000;4336.857775;3279.634062;2910.235036;11075.438477;-11075.438477;11075.438477;81.914001;-67.497137;81.914001;0xA079;18;3\r\n" "7.000000;34312.000000;-63.000000;-11075.438477;81.914001;-1954.181763;-2606.245117;30.500000;4.210000;0.000000;4336.857775;3279.634062;2910.235036;11075.438477;-11075.438477;11075.438477;81.914001;-67.497137;81.914001;0xA079;18;3\r\n"; QString sre = "(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+);(.+)\r\n"; QRegularExpression re; re.setPattern(sre); qDebug() << re.match(s).hasMatch(); auto mi = re.globalMatch(s); while (mi.hasNext()) qDebug() << mi.next().captured(0);
See attached project for better formatted and explained code.