help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to re-search for ^"*Nanotechnology*"$


From: Stephen Berman
Subject: Re: How to re-search for ^"*Nanotechnology*"$
Date: Wed, 05 Sep 2007 15:27:42 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

On Wed, 05 Sep 2007 05:32:22 -0700 Mirko <mvukovic@nycap.rr.com> 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]