Actually there is such a pattern:
QRegExp rx = QRegExp("^(?!ТЕСТ-М[^\\S*\\d*]).*$"); qDebug() << rx.indexIn("привет") << rx.indexIn("ТЕСТ-М60") << rx.indexIn("ТЕСТ-М"); At the exit, I get 0 0 0 , respectively, all three words matched. However, this pattern should not match the third word. And, for example, this does not happen here: regexstorm
Can I somehow not correctly set the pattern in Qt?
QRegExp("^(?!ТЕСТ-М(?:\\s|$)).*$")? Shouldn't a string start withТЕСТ-Мfollowed by a whitespace or the end of a string? - Wiktor Stribiżew[^\\S*\\d*]- this is - garbage. - Qwertiy ♦