Make the whitespace regex lazy and changed the last group to no-capture.
Fixed issue where an end of line would sometimes be stripped.