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

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

regexp matches, but in some cases changes replace-match


From: Gijs Hillenius
Subject: regexp matches, but in some cases changes replace-match
Date: Mon, 20 Aug 2012 12:13:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

I use the following function to put some basic html tags in a text. The
regexp matches all subheadings.

,----
| (defun subheading ()
|   (interactive) ;; interactive for testing purpose
|   (while (re-search-forward ".*[a-zA-Z':][\n]" nil t) (replace-match "<br 
/>\n<strong>\\&</strong><br />" nil nil)))
`----

What I don't understand: when the subheading is a single word, the
replace-match changes to "<Br />\n<Strong>\\&</Strong><Br />" (the tags
get capitals). My regexp is, somehow, inprecise.


reply via email to

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