U++ framework
Do not panic. Ask here before giving up.

Home » Community » Coffee corner » Extracting links challenge
Extracting links challenge [message #44151] Fri, 09 January 2015 11:05 Go to next message
mirek is currently offline  mirek
Messages: 14290
Registered: November 2005
Ultimate Member
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";
}



Re: Extracting links challenge [message #44152 is a reply to message #44151] Fri, 09 January 2015 14:45 Go to previous messageGo to next message
axeoth is currently offline  axeoth
Messages: 2
Registered: January 2015
Junior Member
This is a first message that will allow me to post a link after.
Re: Extracting links challenge [message #44156 is a reply to message #44151] Sat, 10 January 2015 20:05 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3458
Registered: August 2008
Senior Veteran
Shocked Shocked
Laughing


Best regards
IƱaki
Re: Extracting links challenge [message #44157 is a reply to message #44151] Sat, 10 January 2015 21:10 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 1266
Registered: August 2007
Senior Contributor
Quote:

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";
}


This is really cool and also a pleasure suprise to me. I didn't know that U++ has a RegExp class... Shocked
Too bad that it is not documented (in Topic++).

Regards,
Oblivion.


[Updated on: Sat, 10 January 2015 21:12]

Report message to a moderator

Previous Topic: Raspberry Pi
Next Topic: How would you design a good copy/move semantics system?
Goto Forum:
  


Current Time: Thu Apr 30 19:21:18 GMT+2 2026

Total time taken to generate the page: 0.00511 seconds