unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: nunojsilva@invalid.invalid (Nuno J. Silva)
To: help-gnu-emacs@gnu.org
Subject: Re: regular expression
Date: Mon, 25 Jan 2010 12:35:02 +0000	[thread overview]
Message-ID: <87pr4y1hxl.fsf@monolith.local.lan> (raw)
In-Reply-To: 7s5bu9Fg2iU1@mid.individual.net

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.

-- 
Nuno J. Silva
gopher://sdf-eu.org/1/users/njsg


  reply	other threads:[~2010-01-25 12:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-25 11:00 regular expression Burkhard Schultheis
2010-01-25 12:35 ` Nuno J. Silva [this message]
2010-01-25 12:53   ` Helmut Eller
2010-01-26 19:46     ` Nuno J. Silva
2010-01-25 16:34   ` Burkhard Schultheis
2010-01-25 18:12 ` Stefan Monnier
     [not found] <d5b8df44-60fd-4b8f-83d1-cb7d04b2a7b4@googlegroups.com>
2014-06-30 20:04 ` Emanuel Berg
2014-06-30 20:13   ` Emanuel Berg
2014-06-30 20:36     ` Teemu Likonen
     [not found]     ` <mailman.4605.1404160609.1147.help-gnu-emacs@gnu.org>
2014-06-30 20:52       ` Emanuel Berg
2014-06-30 21:04         ` Teemu Likonen
     [not found]         ` <mailman.4609.1404162300.1147.help-gnu-emacs@gnu.org>
2014-06-30 21:11           ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2014-06-30 23:14 Tak Kunihiro
     [not found] <mailman.4622.1404173952.1147.help-gnu-emacs@gnu.org>
2014-07-02  8:33 ` Emanuel Berg
2014-07-02 13:10 Tak Kunihiro
2014-07-02 13:43 ` Stefan Monnier
2014-07-02 23:14 Tak Kunihiro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pr4y1hxl.fsf@monolith.local.lan \
    --to=nunojsilva@invalid.invalid \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).