Allow any whitespace character at end of file

Changing regex to allow for any whitespace character (including \r and \t) at the end of the file

E.g. In Windows it wasn't working because it uses CRLF instead of LF at the end of the lines.
Merge pull request #604 from j-d/patch-1

Allow any whitespace character at end of file