hello

I wrote some code
Qt Code:
  1. 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:
Qt Code:
  1. int pos = 0;
  2.  
  3. while ((pos = reg.indexIn(result, pos)) != -1) {
  4. qDebug()<<result.mid(pos, pos + reg.matchedLength());
  5. pos += reg.matchedLength();
  6. }
To copy to clipboard, switch view to plain text mode 
but it doesn't work... What do I do wrong?