In article , Nordlöw wrote: > I can't get the following example to work programmatically. > > M-x replace-regexp > Replace regexp: \(\w+\) > Replace regexp with: \,(capitalize \1) > > Is this only possible in interactive query-replace? > If so should I use a combination of while(), looking-at(), re-search- > forward(), replace-match(), match-string() etc. Yes. Notice that the documentation of replace-regexp says: In interactive calls, the replacement text may contain `\,' It's a special extension just for interactive use. I'm not sure why it was restricted this way. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group ***