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   |
 |
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
|
|
|
Goto Forum:
Current Time: Wed Aug 27 08:26:02 CEST 2025
Total time taken to generate the page: 0.06567 seconds
|