Reputation: 41
I need a regex to match some file names, actually they are dated logs, and I only need to fetch logs from say 24th to 31st. Also there are 2 type of logs.
Log filenames are as follows:
log_file_first-Type_24-03-2013
log_file_second-Type_24-03-2013
I have tried following:
log_file_(first|second)\-Type_(2,3)(4,1)\-03\-2013
But this takes in 21st also, how to do this?
Upvotes: 2
Views: 591
Reputation: 1428
Regular expressions are powerful, but also have several limitations. There are not so good in integers' ranges. This is not an elegant solution, but works:
log_file_(first|second)\-Type_(2[4-9]|30|31)\-03\-2013
Upvotes: 3