On Thu, 2013-03-28 at 11:11 +0100, Tobias Boege wrote: > > > > > > > > > > Case "BACKIMAGE[[]*]" > > > Case "BACKIMAGE[[]*][[]*]" > > > > > > Is that what you want? > > > > > > Escaping '[' character in regular expression is done by using "[[]" or > > > "\\[". (see the documentation of LIKE). > > > > > ... > "BACKIMAGE[*]", but also something like "BACKIMAGE[a]" which may or maybe > not what Bruce wants...
Thanks guys, That was the escape sequence I needed. I just couldn't see it in the LIKE help page. I guess I'll have to put that "Read EVERY word in the help page!" sign back up above my desk. By way of demystification, we have over 1500 text parameter files that represent 50 or so objects. These have evolved over several generations of the software which now has too much "back compatibility" code in it. So we now need to standardise all these parameter files to the current release "shape". The "xxxIMAGE<subtype>" parameters now looks for example like BACKIMAGE[N][1][0]=filename BACKIMAGE[E][1][0]=filename BACKIMAGE[E][2][0]=filename but different parameter files might have BACKIMAGE[N]=filename,1 (at ver 1.0) BACKIMAGE[E]=filename,1,2 (at ver 3.0) BACKIMAGE[N][3]=filename (at ver 3.x) etc (and xxxIMAGE is only one example of the problem!) Given an arbitrary parameter file there is no way to detect which software version it comes from. This is further exacerbated by the fact that individual lines in a file may accord to different versions of the parameter syntax. So each line in the file has to be parsed to detect its' likely syntax version and reprocessed accordingly. Hence, Select Upper(Split(SourceArray[idx],"=")[0]) Case Like "BACKIMAGE[[]*]" 'looks like a ver 1.0 to 3.0 syntax, so ' parse the second half of the line and pick the correct process Case Like "BACKIMAGE[[]*][[]*]" ' looks like a ver 3.x syntax, so TargetArray[idx]=ReformatBackImage_3x(SourceArray[idx]) Case Like "BACKIMAGE[[*][[*][[*]" ' is current syntax, so TargetArray[idx]=SourceArray[idx] etc etc Thanks again Bruce ------------------------------------------------------------------------------ Own the Future-Intel(R) Level Up Game Demo Contest 2013 Rise to greatness in Intel's independent game demo contest. Compete for recognition, cash, and the chance to get your game on Steam. $5K grand prize plus 10 genre and skill prizes. Submit your demo by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2 _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user