Improved regex to match filenames and updated unit tests.