On regex 101, I wrote the following regular expression:
^(\(|)*(\(|)*(\!|)[AZ](\)|)*((v|\^)(\!|)(\(|)*[AZ](\)|)*)*(v|\^)(\!|)[AZ](\)|)*$
and there everything is fine, it validates my string as it should.
here is my line:
D^!AvB^!(A^Bv(Av!C))v!CvB
but the problem is that when I insert a regular in Qt Creator, the same line does not pass validation. and the isValid() method returns true .
Well, a piece of code from Qt:
QRegExp regExp("^(\(|)*(\(|)*(\!|)[AZ](\)|)*((v|\^)(\!|)(\(|)*[AZ](\)|)*)*(v|\^)(\!|)[AZ](\)|)*$"); if (regExp.isValid()){ cout << "is valid" << endl; } else { cout << regExp.errorString().toStdString() << endl; } cout << regExp.indexIn("D^!AvB^!(A^Bv(Av!C))v!CvB") << endl; // -1 Perhaps in c ++ you cannot write as I wrote, but I do not know, because I do not write in c ++. Correct me where I was wrong.