As it happens, yesterday I updated gnulib regex to use the latest version from GLIBC. This is a big deal: it's a 20,000-line patch. See:
http://lists.gnu.org/archive/html/bug-gnulib/2005-07/msg00041.html I plan to import this change into coreutils today or tomorrow. I also found the bug that Charles Levert mentioned. I fixed it in gnulib and reported it here for glibc: http://sources.redhat.com/bugzilla/show_bug.cgi?id=1054 so you don't need to report it. (I have no response yet from the glibc regex guru.) I suggest that grep use gnulib regex rather than importing regex by hand from glibc. This will require some changes to the patch that Charles Levert proposed in <http://lists.gnu.org/archive/html/bug-grep/2005-07/msg00022.html>. In particular, regex.m4 needs some significant changes; the version in Levert's patch is incorrect for glibc's newer code. Also, one include file gets moved and one removed, so there's no longer a lib/posix/regex.h. Using gnulib will help us all share any such improvements in the build process. I have some more changes in the pipeline, but they are all code/porting cleanups, not bug fixes. You can use gnulib-tool to import sources from gnulib. This is item #2 on grep's TODO list. Presumably you're going to wait on gnulib-tool until after the next grep release, but it should get done eventually; it'll save you some work in the future.