ultimatepp/examples/ExtractLinks/ExtractLinks.cpp
cxl ff1c426cac uppsrc: Crash moved to archive
git-svn-id: svn://ultimatepp.org/upp/trunk@15310 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2020-10-27 08:34:09 +00:00

16 lines
407 B
C++

#include <Core/Core.h>
#include <plugin/pcre/Pcre.h>
using namespace Upp;
// http://isocpp.org/blog/2014/12/myths-3
// section 6.1
CONSOLE_APP_MAIN
{
String s = ToCharset(CHARSET_UTF8, HttpRequest("http://www.stroustrup.com/C++.html").Execute(),
CHARSET_ISO8859_1);
RegExp x("href *= *\"(.*?)\"");
while(x.GlobalMatch(s))
Cout() << x.GetStrings()[0] << "\n";
}