I need to extract all links from html page using regular expressions in C++. Can anybody help me please ?
A:
This is a hard job for a regex, and in C++ it's even harder. I actually wrote a parser for a project I did for school a few years ago. You can use this if you find that it works, but I would test it on what you want before you rely on it for anything important.
Feel free to modify/use it, whatever
I realized there were some mistakes in my code, and that I should probably include the header file. Also included is the cmakelists file but it's trivial. The ParserTest.cpp file basically lets you parse links from an input string from the command line.
Falmarri
2010-09-30 19:55:16
s/hard/impossible/.
Jerry Coffin
2010-09-30 19:57:10
Agreed. But it depends what you mean by parse links. Do you want to parse ALL the links? Because parsing links with a regex is fine, it's just not guaranteed to work =]
Falmarri
2010-09-30 20:05:39