Norihiro Tanaka wrote: > Not only '.' but also hat > list (e.g. [^a]) should match newline with -z. So we need clear > RE_HAT_LISTS_NOT_NEWLINE bit. Thanks for reporting that. I also noticed some related bugs in dfa.c that 'grep' does not exercise (so no grep test cases, alas). Plus, it's long been time that we fix RE_SYNTAX_GREP and RE_SYNTAX_EGREP to match grep's actual behavior. So I installed a Gnulib patch to update RE_SYNTAX_GREP and RE_SYNTAX_EGREP to the fixed behavior (see ) and installed grep patches to sync to gnulib and fix the other problems. The first attached patch I installed yesterday (and you've commented on it) but I didn't have time to send email about it so am attaching it now. The other five attached patches fix the bugs noted above. Here's the justification for the first attached patch. The grep documentation says that '.' matches any character, and this includes both NUL and LF. Ordinarily, LF terminates a line and so is never part of match data, but '.' should still match NUL. Conversely with -z, NUL terminates a line and so is never part of match data, but '.' should still match LF.