[COOK-4110] Relax regex to allow whitespace at the end of a line of output