hello
I wrote some code
QRegExp reg
("\\s*<h1 class=\"demot\">(\\d+)</h1>\\n");
QRegExp reg("\\s*<h1 class=\"demot\">(\\d+)</h1>\\n");
To copy to clipboard, switch view to plain text mode
this should parse a HTML file and find all text in the tag. And the problem is: I cannot get what I want. I wrote:
int pos = 0;
while ((pos = reg.indexIn(result, pos)) != -1) {
qDebug()<<result.mid(pos, pos + reg.matchedLength());
pos += reg.matchedLength();
}
int pos = 0;
while ((pos = reg.indexIn(result, pos)) != -1) {
qDebug()<<result.mid(pos, pos + reg.matchedLength());
pos += reg.matchedLength();
}
To copy to clipboard, switch view to plain text mode
but it doesn't work... What do I do wrong?
Bookmarks