better error handling: bad regex, line/row too long ; prevent accidental reading from stdin if tty