I want to find an exact word "SUBRECORD" with any number of spaces before and after it. I have tried:
\s*SUBRECORD\s*
[ ]*SUBRECORD[ ]*
(\s)*SUBRECORD(\s)*
but none of them work.
EDIT:
this is the snippet of code that's not working:
QStringList list;
list.append("RECORD \"DEFSTA\" \"Definition des Stations\"");
list.append(" STRING (2) \"Version\";");
list.append(" SUBRECORD (2) \"Nb de Stations\";");
list.append(" STRING (30) \"Nom de la Station\"; ");
list.append(" INTEGER (2) \"Numero de la Station\";");
list.append(" INTEGER (4) \"Extra charge\";");
list.append(" STRING (5) \"Mnemonique Station\";");
list.append(" DUMMY (1) \"Réserve\";");
list.append(" ENDSUBRECORD;");
list.append(" SIGNATURE \"Signature\" ; ");
list.append("ENDRECORD;");
qDebug() << "LAST INDEX OF SUBRECORD:" << list.lastIndexOf(QRegExp("\\s*SUBRECORD\\s*"));