|
From: | Oleksandr Gavenko |
Subject: | Re: string searching and saving results to a variable |
Date: | Wed, 16 Feb 2011 11:21:28 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 |
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).
[Prev in Thread] | Current Thread | [Next in Thread] |