home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!noc.near.net!news.bbn.com!think.com!barmar
- From: barmar@think.com (Barry Margolin)
- Newsgroups: gnu.emacs.help
- Subject: Re: regexp question
- Date: 31 Aug 1992 22:29:39 GMT
- Organization: Thinking Machines Corporation, Cambridge MA, USA
- Lines: 18
- Message-ID: <17u6gjINN1a7@early-bird.think.com>
- References: <TBRANNON.92Aug31111138@mars.csee.lehigh.edu>
- NNTP-Posting-Host: telecaster.think.com
-
- In article <TBRANNON.92Aug31111138@mars.csee.lehigh.edu> tbrannon@mars.csee.lehigh.edu (tbrannon) writes:
- >... I wanted to replace the sequnce of underscores with a question
- >mark so I did M-x replace-regexp _* with ? but it put question marks
- >between each letter of all the words.
- >
- >Why did this happen?
-
- * means "zero or more occurrences of the preceding regular expression".
- Since there are zero underscores between each letter, that's a match.
-
- >How can I get replace-regexp to do what I want?
-
- + means "one or more occurrences", so try replacing _+ with ?.
- --
- Barry Margolin
- System Manager, Thinking Machines Corp.
-
- barmar@think.com {uunet,harvard}!think!barmar
-