kabanek
3rd November 2010, 21:22
hello
I wrote some code
QRegExp reg("\\s*<h1 class=\"demot\">(\\d+)</h1>\\n");
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();
}
but it doesn't work... What do I do wrong?
I wrote some code
QRegExp reg("\\s*<h1 class=\"demot\">(\\d+)</h1>\\n");
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();
}
but it doesn't work... What do I do wrong?