Hi thanks, that works great! I modified the regular expression to the file naming format that we use at work. I just noticed that the system of sorting and preserving the latest backup and deleting the rest is the most efficient - my supervisor and dad (he's a programmer) said the same thing.
I don't know why I stuck with the idea of using flags, I guess it's the little mistakes the not-that-experienced programmers make. This is a good learning experience!
I'll figure out the syntax related to sorting that has been implemented and understand it fully. Thanks again to both of you - take care!