The line regex works as follows:

- `.*` matches zero or more _non-newline characters_ (not anything).
- `(?:\r\n?|\n)?` matches an optional newline. A newline is one of `\r\n` (Windows), `\r` (old Macs) and `\n` (unix-like and new Macs).
- `.*(?:\r\n?|\n)?` matches zero or more non-newline characters, followed by an optional newline. That covers the following cases:
  
  - A non-empty line and its newline.
  - An empty line (just a newline).
  - A non-empty line that also is the last line and has no newline at the end.
  
  However, it also matches the empty string, which will populate a `string.match(REGEX.line)` array with lots of empty strings. That is solved by adding `(?=[\s\S])` in front, which says “the beginning of this match must be followed by one character, whatever it is”.
  
Lastly, we must also cover the case where the whole file is empty by also matching the empty string (`^$`).

(I just felt like explaining the regex, even if it will be removed in the next commit.)