$ egrep -V egrep (BSD grep) 2.5.1-FreeBSD $ echo abc > testfile $ iconv -f ASCII -t UTF-16LE testfile > utftestfile $ egrep -c "a.b" /tmp/utftestfile 1 $ egrep -c "a.b|d" /tmp/utftestfile 0 The expected result is that the second "egrep" command should also return 1. This works as expected when using GNU grep 2.15 installed from ports. Also this works as expected with "bsdgrep -E" on FreeBSD 9.1 i386 system. How-To-Repeat: See "Full Description"
A couple of notes here, as of right now: `egrep -c` and `bsdgrep -Ec` seem to be behaving consistently on this one now. Also, I've gotten as far as isolating it to a problem somewhere in the GNU compatibility bits. Enabling WITHOUT_GNU_GREP_COMPAT in /etc/src.conf and rebuilding bsdgrep makes it Just Work (TM). At this point, I'm not sure how to proceed. I did verify that we're setting the cflags right (in accordance with /usr/include/gnu/regex.h), other than that nothing else sticks out as blatantly wrong.
(In reply to Kyle Evans from comment #1) Also worth noting: this equivalent test on a relatively recent Debian machine: > grep (GNU grep) 2.27 $ echo abc > testfile $ iconv -f ASCII -t UTF-16LE testfile > utftestfile $ egrep -c "a.b" /tmp/utftestfile 0 $ egrep -c "a.b|d" /tmp/utftestfile 0
For bugs matching the following conditions: - Status == In Progress - Assignee == "bugs@FreeBSD.org" - Last Modified Year <= 2017 Do - Set Status to "Open"
Adding this to tracking PR; will mark fixed/overcome by events once bsdgrep loses the bits that allow it to be linked against gnuregex.
This is mostly OBE as bsdgrep will now use libregex by default rather than libgnuregex. 11.4 still links against it, but I would tend to recommend not using bsdgrep on 11.x.