Hi Eli and Alan, Thanks for investigating. Don't know if this is of much help, but here's a simpler test file (BitmapFontFace4.h). If I delete all the "YBitmapZ" lines so that only the full-word occurrences of "Bitmap" are left in the file, then C-u M-% replaces everything but replace-regexp doesn't still. Daniel