home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / emacs / 3875 < prev    next >
Encoding:
Internet Message Format  |  1992-12-28  |  1.9 KB

  1. Xref: sparky comp.emacs:3875 gnu.emacs.help:5189 gnu.epoch.misc:1222
  2. Path: sparky!uunet!think.com!enterpoop.mit.edu!eru.mt.luth.se!kth.se!news.kth.se!LEVITTE
  3. From: LEVITTE@e.kth.se (Richard Levitte)
  4. Newsgroups: comp.emacs,gnu.emacs.help,gnu.epoch.misc
  5. Subject: Re: strange replace-regexp behavior
  6. Message-ID: <LEVITTE.92Dec28191527@elmer.e.kth.se>
  7. Date: 28 Dec 92 18:15:27 GMT
  8. References: <1992Dec28.133923.27974@nsisrv.gsfc.nasa.gov>
  9. Sender: usenet@kth.se (Usenet)
  10. Organization: Department of TeleTransmission Theory
  11. Lines: 51
  12. In-Reply-To: pat@gsfc.nasa.gov's message of 28 Dec 92 13:39:23 GMT
  13. Nntp-Posting-Host: elmer.e.kth.se
  14.  
  15. Hmm... I tried to reply by mail, but it bounced.
  16.  
  17. >>>>> On 28 Dec 92 13:39:23 GMT, pat@gsfc.nasa.gov (patrick m. ryan) said:
  18.  
  19. [...]
  20.  
  21. >In article 999, joe@blow said:
  22. >>blah blah blah
  23. >> blah blah blah
  24.  
  25. pmr> I wanted to remove the first '>' in each line.  Thus, I did:
  26.  
  27. pmr>    (replace-regexp "^>" "")
  28.  
  29. [...]
  30.  
  31. =>
  32. pmr> In article 999, joe@blow said:
  33. pmr> blah blah blah
  34. pmr>  blah blah blah
  35.  
  36. I think this is what is happening (^ is the point after each operation):
  37.  
  38. Match:  >In article 999, joe@blow said:
  39.          ^
  40. Repl:   In article 999, joe@blow said:
  41.         ^
  42. ...
  43. Match:  >>blah blah blah
  44.          ^
  45. Repl:   >blah blah blah
  46.         ^
  47.  
  48. Match:  >blah blah blah
  49.          ^
  50. Repl:   blah blah blah
  51.         ^
  52.  
  53. ... and the same for the last line.
  54.  
  55. Instead, try:
  56.  
  57.         (replace-regexp "^>\\(.*$\\)" "\\1")
  58.  
  59. --
  60. !+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++!
  61. ! Richard Levitte, VMS GNU Emacs hacker   ! tel: int+46-8-18 30 99            !
  62. ! Sulv"agen 57, II                        ! fax: none for the moment          !
  63. ! S-126 40 H"agersten                     ! Internet: levitte@e.kth.se        !
  64. ! SWEDEN                                  !                                   !
  65. !-----------------------------------------------------------------------------!
  66.