D
D
d_gal2015-01-14 20:17:31
C++ / C#
d_gal, 2015-01-14 20:17:31

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

2 answer(s)
T
tsarevfs, 2015-01-14
@tsarevfs

Parsing html with regular expressions is not a good idea.
You can find many examples of using specialized libraries for this.

A
Armenian Radio, 2015-01-14
@gbg

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 question

Ask a Question

731 491 924 answers to any question