What version of glibc are you using? I don't use either RH or Gentoo
and so I do not know what glibc version they ship. Your symptoms look
like glibc-2.3.1.
I can reproduce your problem using glibc-2.3.1 on ia64. I have run
into several regular expression problems in that particular version.
This only seems to happen when the RE is not completely clean. As in
the above because you do not need to escape the single quote.
But older versions of glibc are fine and in particular newer glibc
versions are fine for me as well. I believe if you update your glibc
library you will resolve your problem. The problem is gone for me in
glibc-2.3.2.