I have a problem with QRexep patterns. I am basically trying to match lines in a HTML tag, but I want only to match the lines that has the keyword

Qt Code:
  1. regex.setPattern("<div class=\"head\">(keyword1|keyword2):</div>");
  2. regex.setPatternOptions(QRegularExpression::DotMatchesEverythingOption);
  3. QRegularExpressionMatch match = regex.match(data.data());
To copy to clipboard, switch view to plain text mode 


I want to catch the following:

<div class=\"head\">keyword1:</div>
<div class=\"head\">keyword2:</div>

but with the pattern above I get none. I have tried escaping the parentheses around my keywords, but result was the same.

has someone had similar problems, or can some one spot what I am doing wrong, can I do such a thing with QT at all?


Thanks in advance for any advice.