From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: How to re-search for ^"*Nanotechnology*"$ Date: Wed, 05 Sep 2007 15:27:42 +0200 Message-ID: <87ir6pp7ht.fsf@escher.local.home> References: <1188995542.671074.138780@r34g2000hsd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1188998919 21274 80.91.229.12 (5 Sep 2007 13:28:39 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 5 Sep 2007 13:28:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 05 15:28:39 2007 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 1ISuvq-0003GG-KF for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Sep 2007 15:28:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ISuvo-0007NT-Um for geh-help-gnu-emacs@m.gmane.org; Wed, 05 Sep 2007 09:28:33 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1ISuvF-0006wq-E7 for help-gnu-emacs@gnu.org; Wed, 05 Sep 2007 09:27:57 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1ISuvE-0006vO-Hj for help-gnu-emacs@gnu.org; Wed, 05 Sep 2007 09:27:56 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1ISuvE-0006v5-AB for help-gnu-emacs@gnu.org; Wed, 05 Sep 2007 09:27:56 -0400 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1ISuvD-0007zS-R5 for help-gnu-emacs@gnu.org; Wed, 05 Sep 2007 09:27:56 -0400 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1ISuv7-000588-0z for help-gnu-emacs@gnu.org; Wed, 05 Sep 2007 15:27:49 +0200 Original-Received: from i577bc765.versanet.de ([87.123.199.101]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Sep 2007 15:27:49 +0200 Original-Received: from Stephen.Berman by i577bc765.versanet.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 05 Sep 2007 15:27:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 26 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: i577bc765.versanet.de User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux) X-Detected-Kernel: Linux 2.6, seldom 2.4 (older, 4) 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:47233 Archived-At: On Wed, 05 Sep 2007 05:32:22 -0700 Mirko wrote: > Hello, > > how does one write the regular expression search (in elisp) to look > for > ^"*Nanotechnology*"$ > > (The string is inclosed by *'s and these are the only characters on > the line. > > My attempt > (re-search-forward "\*[a-zA-Z ]+\*") > fails. You need to escape the the backslashes for the Lisp reader to recognize their use as an escape character in the regular expression: (re-search-forward "^\\*[a-zA-Z ]+\\*$") > Also, if you could (please) show me how to use the [:alpha:] > construct. (re-search-forward "^\\*[[:alpha:]]+\\*$") Steve Berman