#include <Core/Core.h> #include <plugin/pcre/Pcre.h> 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"; }
Report message to a moderator
I have stumbled on this: http://codegolf.stackexchange.com/questions/44278/debunking- stroustrups-debunking-of-the-myth-c-is-for-large-complicated -pro so naturally, here is the U++ version: #include <Core/Core.h> #include <plugin/pcre/Pcre.h> 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"; }
[Updated on: Sat, 10 January 2015 21:12]