Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have many files in a folder and the filenames fall into different patterns:
123 store_location1.xlsm
234 store_location2.xlsm
235 store_location3.xlsm
....
1 - Grocery.xlsm
2 - Dairy.xlsm
...
Division 1 - Grocery.xlsm
Division 2 - Grocery.xlsm
...
How can I get only these files that the names start with 3 digits?
Please help!
Thank you Dijke very much for your quick response!
If I want to filter the ones that filenames start with 3 digits, and the extension could either be .xlsm or .xls,
should the modified regex expression to be:
"^[0-9]{3}.+xls$"
?
Could you please give a quick explanation about how this expression works?
Thanks!
TM
add a question mark ? after the m to optionally match the m
^[0-9]{3}.+xlsm?$
^ match start of line
[0-9]{3} match 3 numbers that range from 0-9
.+ match any character one or more times
xlsm? match the letters "xls" and optionally "m"
$ match end of line
Can anyone recommend a site for people like me to learn Regex Expression step by step?