all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* string searching and saving results to a variable
@ 2011-02-15 23:15 ken
  2011-02-15 23:33 ` Perry Smith
  0 siblings, 1 reply; 11+ messages in thread
From: ken @ 2011-02-15 23:15 UTC (permalink / raw)
  To: GNU Emacs List

It's time again to write an elisp function!!

One thing it needs to do a couple of times is save a string to a
variable.  The string to save will be an html header, like:

<h3>Section 4</h3>

but it could be multiple lines like this

<h3 class="newest-chapter-section-type" align="center">On
the origins of elisp confusion</h3>

It could even be three or four lines long.  Also, the line(s) could be
indented and so have unwanted white space in the first several columns.

Assuming the point is somewhere on that line or one of those lines, we do:

(end-of-line)    ; to preclude the point being at the far left.
; find the start of the string:
(re-search-backward "<h1\\|<h2\\|<h3\\|<h4\\|<h5" nil t)
;;somehow mark this as the beginning of the string???

;find the endpoint of the string:
(re-search-forward "</h1>\\|</h2>\\|</h3>\\|</h4>\\|</h5>" nil t)

;;save string to a variable to do other things with... how???


Thanks for any help.




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-02-19 11:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.