Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!samsung!munnari.oz.au!manuel!csc.canberra.edu.au!echo!rpj From: rpj@echo.canberra.edu.au (Ross Johnson) Newsgroups: comp.editors Subject: Re: Using regular expressions in Micro Emacs 3.10 Message-ID: Date: 19 May 91 12:32:24 GMT References: Sender: news@csc.canberra.edu.au Distribution: comp Organization: Info Sci & Eng, University of Canberra Lines: 31 In badri@warren.mentorg.com (Badri Lokanathan) writes: >I am running Micro Emacs 3.10 alpha on a Mac. >I encountered a couple of problems with the replace command: >(2) Is it possible to "remember" a matched pattern and interpolate it >into the replacement pattern (ala vi)? For those who are familiar with >vi, how does one achieve something like >s/\([a-z0-9]*\)_\([a-z0-9]*\)/\2_\1/ If you have or can get a version of "sed" for Macs then you could use the filter-buffer (^X#) command using: sed -e "s/\([a-z0-9]*\)_\([a-z0-9]*\)/\2_\1/" as the filter command line. This works on both PC and Unix MicroEmacs (I just checked). Cheers, PS. I'm assuming Macs can do filtering, can they? -- +----------------------+---+ | Ross Johnson | | E-Mail: rpj@ise.canberra.edu.au | Info Sciences and Eng|___| | University of Canberra | UUCP : uunet!munnari!ise.canberra.edu.au!rpj | PO Box 1 | JANET : rpj%au.edu.canberra.ise@EAN-RELAY | Belconnen ACT 2616 | BITNET: rpj%ise.canberra.edu.au@relay.cs.net | AUSTRALIA | +--------------------------+