From: Oleksandr Gavenko <gavenko@bifit.com.ua>
To: help-gnu-emacs@gnu.org
Subject: Re: string searching and saving results to a variable
Date: Wed, 16 Feb 2011 11:21:28 +0200 [thread overview]
Message-ID: <ijg4uk$68m$1@dough.gmane.org> (raw)
In-Reply-To: <4D5B74FC.80204@mousecar.com>
On 16.02.2011 8:55, ken wrote:
> I'm guessing it could then be done more elispishly as
>
> (setq dog (buffer-substring
> (re-search-backward "<h1\\|<h2\\|<h3\\|<h4\\|<h5" nil t)
> (re-search-forward "</h1>\\|</h2>\\|</h3>\\|</h4>\\|</h5>" nil t)))
>
How about if search fail?
Evaluating of
(buffer-substring nil nil)
take (wrong-type-argument integer-or-marker-p nil).
next prev parent reply other threads:[~2011-02-16 9:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-15 23:15 string searching and saving results to a variable ken
2011-02-15 23:33 ` Perry Smith
2011-02-16 6:55 ` ken
2011-02-16 9:21 ` Oleksandr Gavenko [this message]
2011-02-16 16:58 ` ken
2011-02-19 11:16 ` Oleksandr Gavenko
2011-02-16 11:28 ` Le Wang
2011-02-17 10:51 ` ken
2011-02-17 13:30 ` Perry Smith
2011-02-18 17:33 ` ken
2011-02-18 18:16 ` Le Wang
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='ijg4uk$68m$1@dough.gmane.org' \
--to=gavenko@bifit.com.ua \
--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).