Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!decwrl!bacchus.pa.dec.com!decuac!hadron!jsdy From: jsdy@hadron.COM (Joseph S. D. Yao) Newsgroups: comp.editors Subject: Re: ex search & substitution question Summary: Yet another quick comment on ... Message-ID: <903@hadron.COM> Date: 9 Aug 90 20:36:18 GMT References: <3440001@hprnd.HP.COM> <26814@nigel.ee.udel.edu> <1990Aug07.174235.28911@hoss.unl.edu> <1990Aug9.003212.12140@monu6.cc.monash.edu.au> Reply-To: jsdy@hadron.UUCP (Joseph S. D. Yao) Organization: Hadron, Inc., Fairfax, VA Lines: 23 In article <1990Aug9.003212.12140@monu6.cc.monash.edu.au> edp367s@monu6.cc.monash.edu.au (Rik Harris) writes: >sanjiv@hoss.unl.edu (Sanjiv K. Bhatia) writes: >>:10,20s/^#[iut]55/77/ >a more complicated solution is required: >:10,20s/\(^#[iut]\)55/\177/ Just to note that the left anchor, '^', must be outside the escaped parentheses. While this works, I'd prefer the :10,20g/^#[iut]55/s/55/71/ [note corrected second number] technique, because I sometimes make mistakes typing in the more complicated expressions. It is always possible to find a correct substitute command; I don't know why one person complained that this way led to errors. But both work, so whichever works best for YOU is the one you should use. Joe Yao jsdy@hadron.COM ( jsdy%hadron.COM@{uunet.UU.NET,decuac.DEC.COM} ) arc,arinc,att,avatar,blkcat,cos,decuac,\ dtix,ecogong,grebyn,inco,insight,kcwc, \ lepton,lsw,netex,netxcom,phw5,research, >!hadron!jsdy rlgvax,seismo,sms,smsdpg,sundc,telenet, / uunet / (Last I counted ...)