fixing issue #96, the regex used to match files is hanging in Windows 7 x64, so changing to use path.dirname instead