Hi Dangelor,
Thank you for your reply!
First of all, RegularExpression (RegExp) is totally new to me, but looks like it will be very useful for a whole raft of things that I've already done not to mention things in the future!
I've had a quick read up about it and have a basic understanding, but apologies if I have not understood correctly...
From what I can see,
should mean that it is looking for a pattern of 4 numbers (this corresponds to the year), followed by
2 digits for the month for the Month, then Day;Hour;Min;Second.
Can I ask, is this line of code saying,
Search for file starting with "ImportantFile_",
-> followed by a 4 digit number,
-> Not sure how to read this one... Does this mean (a) followed by a 2 digit number (b) followed by a "-" and then a 2 digit number OR (c) followed by "-" (which is pattern for a range), the range being a 2 digit number ?
I didn't see curly brackets {} referred to in the descriptions I looked at - is this simply a short hand for 2 digits? Could this
also have been written as the longer version of
?
This looks like it will return ALL files with ANY dates and times in this format.
What I am looking to return is ALL files with TODAY's date (or at least a specific date).
So, presumably I would change the expression from:
to:
?
The normal way I would go about this would be to Compare the first part of the filename using Instr and then also check the string length and extension file type.
What are the advantages of this method?
Is it likely to be significantly quicker at sifting through large numbers of filenames?
Thanks,
John
Bookmarks