Do you have information about the structure of the file name? If (I'm guessing) it is a combination of fields joined by underscores, and you know that the first part is the account number with leading zeros followed by two digits, then you should make use of this knowledge. For example,
- split along the underscores,
- take the first field,
- remove the leading zeroes and the last two digits
- and compare against the account number you want to find.
Even if this is slower than other approaches, it will avoid false matches. With respect to account numbers I would think that accuracy is more important than performance.
If you want you can encode this into a regex like /^0*(\d+)\d\d_/
(still based on my guess above).