Answer the question
In order to leave comments, you need to log in
Why do I only get the last match when parsing an html page in c++?
Hello everyone :)
It was necessary to parse the html-page. I did it with regular expressions. Searches for what is needed, but displays only the last match.
Here is a loop in which I display the result
for (Match^ match = regex->Match( code ); match->Success; match = match->NextMatch( ) )
{
if( match->Value->Length > 0 )
{
richTextBox2- >Text = match->Value;
}
}
Help solve the problem, please!
Answer the question
In order to leave comments, you need to log in
Parsing html with regular expressions is not a good idea.
You can find many examples of using specialized libraries for this.
And what is your task? Extract data from a page? Display it? Modify?
Qt has HTML support and a built-in browser.
You can also try to feed this data to an XML parser, but for this it must be somehow similar to XHTML.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question