home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / gnu / emacs / help / 3910 < prev    next >
Encoding:
Internet Message Format  |  1992-08-31  |  1.1 KB

  1. Path: sparky!uunet!noc.near.net!news.bbn.com!think.com!barmar
  2. From: barmar@think.com (Barry Margolin)
  3. Newsgroups: gnu.emacs.help
  4. Subject: Re: regexp question
  5. Date: 31 Aug 1992 22:29:39 GMT
  6. Organization: Thinking Machines Corporation, Cambridge MA, USA
  7. Lines: 18
  8. Message-ID: <17u6gjINN1a7@early-bird.think.com>
  9. References: <TBRANNON.92Aug31111138@mars.csee.lehigh.edu>
  10. NNTP-Posting-Host: telecaster.think.com
  11.  
  12. In article <TBRANNON.92Aug31111138@mars.csee.lehigh.edu> tbrannon@mars.csee.lehigh.edu (tbrannon) writes:
  13. >... I wanted to replace the sequnce of underscores with a question
  14. >mark so I did M-x replace-regexp _* with ? but it put question marks
  15. >between each letter of all the words. 
  16. >
  17. >Why did this happen?
  18.  
  19. * means "zero or more occurrences of the preceding regular expression".
  20. Since there are zero underscores between each letter, that's a match.
  21.  
  22. >How can I get replace-regexp to do what I want?
  23.  
  24. + means "one or more occurrences", so try replacing _+ with ?.
  25. -- 
  26. Barry Margolin
  27. System Manager, Thinking Machines Corp.
  28.  
  29. barmar@think.com          {uunet,harvard}!think!barmar
  30.