Instead of a regex with portability implications, just use String#lines.