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.