Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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: 13467
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: 3268
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: 932
Registered: August 2007
Experienced 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: Mon Dec 06 14:38:16 CET 2021

Total time taken to generate the page: 0.01204 seconds