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

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

Re: Regex Problem


From: Xah
Subject: Re: Regex Problem
Date: Sun, 20 Jul 2008 00:48:36 -0700 (PDT)
User-agent: G2/1.0

On Jul 19, 10:50 am, travis jeffery <address@hidden> wrote:
> I'm trying to write and extension for using tumbr. In tumblr there are two
> requirements for a post; title and body.
>
> So I set up a tumblr post document as:
> title:
> body:
>
> So get the title I use (string-match "\\title: \(.*\)\$"), which is fine
> because it's on a single line. But with I'm having trouble getting the body
> because it's multiple lines. So is there someway I can get any text
> following the body:_space_? I was thinking also of saving the entire buffer
> and then subtracting the title: TITLE and body:_space_ but I still don't
> know about that.
>
> Thanks for your help.

to get text out of the “body:”, you can do something like this:

(goto-char 1)
(search-forward "body:")
(setq mytext (buffer-substring-no-properties (point) (1+ (buffer-
size))))

for some basic elisp functions, see
 http://xahlee.org/emacs/elisp_common_functions.html

  Xah
∑ http://xahlee.org/

reply via email to

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