Parsing directory entries from Windows "dir" command


How to write a regular expression to parse sub directory entries from the output of Windows "dir" command?

Here is an example output of the "dir" command:?



Here is a regular expression to parse file entries from output of the "dir" command on Windows systems: with multiple lines modifier "m": Note that:

(\d{2}/\d{2}/\d{4}\s+\d{2}:\d{2}\s+[AP]M) - Timestamp
(<DIR>)                                   - DIR flag
(.+)                                      - Directory name

Click the button to test this regular expression here online:

2013-02-01, 0👍, 0💬