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

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

Re: Regex Problem


From: Nikolaj Schumacher
Subject: Re: Regex Problem
Date: Tue, 22 Jul 2008 14:29:07 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux)

Thr4wn <address@hidden> wrote:

> In an emacs regexp, you can directly enter a newline character as a
> possible match by hitting C-j (will appear as ^J in the regexp) and/or
> C-q C-m

You can, but you should most definitely not.  It just makes the text
hard to read or edit in anything other than Emacs.  Just use \n.

> Since Windows requires all lines to end with \r\n, I would allow for
> either ^J or ^M in the search).

I believe Emacs buffers will only contain \n even for Windows files.

> On Jul 19, 1:50 pm, travis jeffery <address@hidden> wrote:
>> So I set up a tumblr post document as:
>> title:
>> body:
>>
>> So get the title I use (string-match "\\title: \(.*\)\$"), which is fine

What do you mean by document?  A file or a buffer?  If so, why do you
use string-match?  You can just search around in the buffer, which
should be more efficient.

regards,
Nikolaj Schumacher




reply via email to

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