diff --git a/examples/ExtractLinks/ExtractLinks.cpp b/examples/ExtractLinks/ExtractLinks.cpp new file mode 100644 index 000000000..a895b9881 --- /dev/null +++ b/examples/ExtractLinks/ExtractLinks.cpp @@ -0,0 +1,13 @@ +#include +#include + +using namespace Upp; + +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"; +} diff --git a/examples/ExtractLinks/ExtractLinks.upp b/examples/ExtractLinks/ExtractLinks.upp new file mode 100644 index 000000000..b4de2a290 --- /dev/null +++ b/examples/ExtractLinks/ExtractLinks.upp @@ -0,0 +1,12 @@ +description "Loading links from page, inspired by http://isocpp.org/blog/2014/12/myths-3 6.1\377"; + +uses + Core, + plugin/pcre; + +file + ExtractLinks.cpp; + +mainconfig + "" = "SSE2"; + diff --git a/examples/ExtractLinks/init b/examples/ExtractLinks/init new file mode 100644 index 000000000..47a6ae43c --- /dev/null +++ b/examples/ExtractLinks/init @@ -0,0 +1,5 @@ +#ifndef _ExtractLinks_icpp_init_stub +#define _ExtractLinks_icpp_init_stub +#include "Core/init" +#include "plugin/pcre/init" +#endif