Thanks for your suggestion. I think I we're better off avoiding the use of regular expressions in this function since we would have to make an entire copy of the text and to iterate twice over its characters. Take into account that most of the time only a few HTML tags will appear before the first alphanumerical character, so we might want to stop as soon as we see it.

However, using 'foreach' and 'isLetterOrNumber()', I think is a good idea.

I propose this piece of code:

    bool in_tag = false;
    foreach (const QChar& c, html) {
      if (!in_tag and c.isLetterOrNumber())
        return true;
      else if (c == QChar('<'))
        in_tag = true;
      else if (c == QChar('>'))
        in_tag = false;
    }
    return false;
What do you think?