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 » Newbie corner » What's wrong in this regexp ? [SOLVED,FIXED]
What's wrong in this regexp ? [SOLVED,FIXED] [message #36272] Thu, 17 May 2012 16:08 Go to previous message
awlee is currently offline  awlee
Messages: 4
Registered: May 2012
Junior Member
Hi,

I have some problem with this code and I don't understand what's wrong Sad

#include <CtrlLib/CtrlLib.h>
#include <plugin/pcre/pcre.h>
#include <Web/Web.h>

using namespace Upp;

GUI_APP_MAIN
{
	String content;
	HttpClient web;
	web.URL("http://ultimatepp.org");
	content = web.ExecuteRedirect(3,3); // read html page
	
	String regexp = "http-equiv=\"content-type\"[^>]+charset=([^\\s\"]+).*?<title>([^<]+)";

	RegExp r0(regexp,PCRE_CASELESS|PCRE_MULTILINE|PCRE_DOTALL);

	PromptOK("Test1");
	if (r0.Match(content))
		if (r0.GetCount() > 0)
			for (int i=0; i<r0.GetCount(); ++i)
				PromptOK(r0[i]);
			
	PromptOK("Test2");
	content = "<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" /><meta name=\"generator\" content=\"U++ HTML Package\"><title>Woooow!</title>";
	if (r0.Match(content))
		if (r0.GetCount() > 0)
			for (int i=0; i<r0.GetCount(); ++i)
				PromptOK(r0[i]);

	PromptOK("End");
}

At "Test1" it won't show anything
At "Test2" all is ok

P.S. Windows 7 Home Basic x64, MSSDK 7.1 x64, U++ b4193

[Updated on: Wed, 23 May 2012 00:34]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Strange problem using URR...
Next Topic: Problem with Refreshing GUI...
Goto Forum:
  


Current Time: Thu Jun 06 12:36:25 CEST 2024

Total time taken to generate the page: 0.01374 seconds