ich hab vor einen Parser zu bauen für VRML-Dateien. Nun scheitere ich schon an dem RegEx.
Dies ist der Testtext
Code: Alles auswählen
point[abc][
def]point[ghi]
[jk
l]
Code: Alles auswählen
QRegExp regExp("point\\[(.*)\\]");
regExp.setMinimal(true);
int count = 0;
int pos = 0;
while ((pos = regExp.indexIn(QString(line), pos)) != -1) {
++count;
pos += regExp.matchedLength();
}
qDebug() << "Count:" << count;
Nun ist es so, dass auch Leerzeichen und Newlines drin vorkommt.
Z.B. so
Code: Alles auswählen
point
[ab c][
def] point [g h i]
[ jk
l]
Kann mir da jemand evtl. helfen?