[fpc-pascal] findfirst wildcards...

Graeme Geldenhuys ggeldenhuys at qts.co.uk
Wed Dec 3 10:48:42 CET 2014


On Tue, 2 Dec 2014, waldo kitty wrote:

> how do you process for multiple filemasks?
>
> eg: find ts??????.sel and t???.sel for the same processing run


I don't think FindFirst and FindNext has that capability. I would use the
AllMasks constant and then manually match using a simple regex that caters
for all variations you need. Yes, FindNext will initially match every
file, but doesn't the underlying system have to look at every file anyway
to only return a specific mask?

Just for your reference, the simple masks syntax.

   ?  matches a single character
   *  matches multiple characters

With regex you have MUCH greater control over how to match something. For
example, here is a simple regex to match the mask you listed above. I
don't know how strict you want the ??? text so I used a . (any character
exect \n), but you might want to tone that down a bit.

   t(?:.{3}|s.{6})\.sel

Regards,
   Graeme



This email and its attachments may be confidential and are intended solely for the use of the individual to whom it is addressed. Any views or opinions are solely those of the author and do not necessarily represent those of Quality Technology Systems Ltd. If you are not the intended recipient of this email and its attachments, you must take no action based upon them, nor must you copy or show them to anyone. If you receive the message in error, please immediately delete it, destroy all copies of it and notify the sender. Internet email is not a totally secure medium and therefore Quality Technology Systems Ltd does not accept legal responsibility for the contents of this message. We have taken steps to ensure that this email and any attachments are free from viruses. However, we cannot accept any responsibility for any virus transmitted by us and recommend that you subject any incoming email to your own virus checking procedure. Registered in England No. 3208823



More information about the fpc-pascal mailing list