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

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

Re: regular expression


From: Burkhard Schultheis
Subject: Re: regular expression
Date: Mon, 25 Jan 2010 17:34:29 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.1.5) Gecko/20091204 Thunderbird/3.0

Am 25.01.2010 13:35, schrieb Nuno J. Silva:
Burkhard Schultheis<burkhard.schultheis@web.de>  writes:

I want to search for the following string: A hyphen not surrounded by
spaces. Therefore I tried the following pattern:
[^ ]-[^ ].
But this pattern finds a hyphen preceded by a letter and followed by a
newline character, too.

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

I made up some test text in a buffer, and tried search-forward-regexp
with

[^ ]-[^ \n]

and

[^ ]-[^
]

The second one works here. It has the result of hitting C-q C-j, instead
of \n, because there are other places where emacs won't match a newline
with \n, and needs this.


Here too! Thank you very much!

Regards
Burkhard


reply via email to

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