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

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

Re: string searching and saving results to a variable


From: Le Wang
Subject: Re: string searching and saving results to a variable
Date: Wed, 16 Feb 2011 19:28:58 +0800

On Wed, Feb 16, 2011 at 2:55 PM, ken <address@hidden> wrote:
(setq dog (buffer-substring
 (re-search-backward "<h1\\|<h2\\|<h3\\|<h4\\|<h5" nil t)
 (re-search-forward "</h1>\\|</h2>\\|</h3>\\|</h4>\\|</h5>" nil t)))

What mode are you using to edit html?  What version of Emacs?  It's likely your major-mode supports balanced tag movements, so this hacky regexp searching isn't necessary.

What do you want o do with the saved text?  Why don't you try to compose the function to the best of your ability, and I'm sure someone will give you hints for what you can't get working.

--
Le

reply via email to

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