+ static const auto re_pattern = R"(\s*([-+]?)\s*([0-9]+\.?[0-9]*).*)";
+
+ bool has_match;
+ QStringList captures;
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+ QRegularExpression re(re_pattern);
+ has_match = re.match(text()).hasMatch();
+ if (has_match) {
+ captures = re.match(text()).capturedTexts();
+ }
+#else
+ QRegExp re(re_pattern);
+ has_match = re.exactMatch(text());
+ if (has_match) {
+ captures = re.capturedTexts();
+ }
+#endif