Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!convex!tchrist@convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.unix.questions Subject: Re: a perl question Message-ID: <3013@convex.UUCP> Date: 11 Nov 89 17:52:24 GMT References: Sender: usenet@convex.UUCP Reply-To: tchrist@convex.COM (Tom Christiansen) Distribution: comp Organization: CONVEX Software Development, Richardson, TX Lines: 26 I just got mail from Larry Wall who pointed out that you need to use \1 in the LHS of the substitute. He said: |You want something like this: | | s/(.)\010\1/<<<$1>>>/g; | s/>>><<>> can be anything that don't occur in the text. | |Within a pattern you want to use \1, not $1, because $1 means interpolate |the previous pattern match. Which makes it work. When you're done, change the <<< and >>> into start-standout and end-standout, like this: s/<<>>/$SE/g; --tom Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "EMACS belongs in : Editor too big!"