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 » U++ Library support » U++ Core » PatternMatchMulti problem
Re: PatternMatchMulti problem [message #26994 is a reply to message #26993] Sat, 19 June 2010 11:47 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14267
Registered: November 2005
Ultimate Member
koldo wrote on Fri, 18 June 2010 07:33

Hello all

Now PatternMatchMulti implementation is this:

bool PatternMatchMulti(const char *p, const char *s) {
	String pt;
	while(*p) {
		if(*p == ';' || *p == ',' || *p == ' ') {
			if(PatternMatch(pt, s)) return true;
			p++;
			while(*p == ';' || *p == ',' || *p == ' ') p++;
			pt.Clear();
		}
		else
			pt.Cat(*p++);
	}
	return pt.IsEmpty() ? false : PatternMatch(pt, s);
}


It separates patterns with ';', ',' and ' '. I thing to have patterns with spaces it would be better to remove the ' ' form the function.


It is designed to be used with file patterns - spaces are unlikely. Especially in FileSel, using ' ' as separator is common. Changing behaviour would be break a lot of existing code.

Also, space as separator works in commandline. So perhaps, if you insist on changing behaviour, we should rather introduce "pattern with spaces" (using ").

Mirek

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: DeXml() incomplete
Next Topic: int64 formating
Goto Forum:
  


Current Time: Wed Aug 27 08:26:02 CEST 2025

Total time taken to generate the page: 0.06567 seconds