gig-raf
17th February 2016, 12:00
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
regex.setPattern("<div class=\"head\">(keyword1|keyword2):</div>");
regex.setPatternOptions(QRegularExpression::DotMat chesEverythingOption);
QRegularExpressionMatch match = regex.match(data.data());
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.
regex.setPattern("<div class=\"head\">(keyword1|keyword2):</div>");
regex.setPatternOptions(QRegularExpression::DotMat chesEverythingOption);
QRegularExpressionMatch match = regex.match(data.data());
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.