I don't think this regex is what you want. This *will* match an empty file (due to the *), but will also match a file with only `[A-Za-z0-9_]` chars, which is not what you want.

To match empty or only whitespace, I think it should be `/^\s*$/`.