[Top][All Lists]

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

Re: regular expression

From: Stefan Monnier
Subject: Re: regular expression
Date: Mon, 25 Jan 2010 13:12:10 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.91 (gnu/linux)

> How to exclude the newline character? I tried
> [^ ]-[^ \n]
> but that does not work. Why? And how to search for this?

\n is the representation of a newline inside an Elisp string, so it will
work if you do (re-search-forward "[^ ]-[^ \n]").  If it didn't work for
you, it's most likely because you typed that text not within an Elisp
string, but at a minibuffer prompt, where there's no such
backslash-espaces.  Instead you want to do hit C-q C-j to insert an
actual newline.


reply via email to

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