From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Giorgos Keramidas Newsgroups: gmane.emacs.help Subject: Re: How to highlight the matching reqular expression strings Date: Tue, 17 Mar 2009 10:55:29 +0200 Organization: SunSITE.dk - Supporting Open source Message-ID: <87hc1sle9q.fsf@kobe.laptop> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1237282967 24337 80.91.229.12 (17 Mar 2009 09:42:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 17 Mar 2009 09:42:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Mar 17 10:44:03 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LjVq7-0003TX-NY for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 10:44:03 +0100 Original-Received: from localhost ([127.0.0.1]:44940 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LjVol-00029y-DI for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Mar 2009 05:42:39 -0400 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news2.glorb.com!feeder.erje.net!feeder.news-service.com!news-out1.kabelfoon.nl!newsfeed.kabelfoon.nl!xindi.nntp.kabelfoon.nl!news.banetele.no!dotsrc.org!filter.dotsrc.org!news.dotsrc.org!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (berkeley-unix) Cancel-Lock: sha1:82yePm6yaaBFY0BIGcq81hyn+AM= Original-Lines: 25 Original-NNTP-Posting-Host: 77.49.245.96 Original-X-Trace: news.sunsite.dk DXC=Y; NaHh=H; @jO3d^23S\Y2mYSB=nbEKnkkML^MjgbH?lJH1Tkjlc<=PaM; B0bhK@0j`ak]V:e Original-X-Complaints-To: staff@sunsite.dk Original-Xref: news.stanford.edu gnu.emacs.help:167709 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:63006 Archived-At: On Tue, 17 Mar 2009 09:59:27 +0530, Anand Dhanakshirur wrote: >>> Kindly tell me How to do regular expression seach in emacs buffer. >>> for ex: i want to know(highlight) the all the text which are als*. >>> >> >> C-u C-s a l s * > > Hi Bastien, > Thanks, > It worked for regexp like als.bd(any character). > It highlighted the matching strings. > But it did not work for als*bd(mutliple characters). > It did not highlight the matching strings. > How to do this? The '*' character has a special meaning in reguar expressions. It means `zero or more occurences of the last regular expression part'. So, when you try to highlight `als*bd' it will match with `albd', `alsbd', and `alssbd' but not with `als?bd' where '?' is any other character than 's'. Try running `M-x highlight-regexp RET als.*bd RET' The extra '.' before the special '*' character means `any character', so this will match text like `alsbd', `alsabd', `alsbbd', ..., `alsaabd', `alsabbd', `alsacbd', and so on.