unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* force upper case of matched regex text pattern
@ 2008-03-13  3:12 xahlee
  2008-03-13  8:53 ` Andreas Röhler
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: xahlee @ 2008-03-13  3:12 UTC (permalink / raw)
  To: help-gnu-emacs

is there a way to force to upper case of a matched regex text pattern?

(i recall having seen it somewhere)

Currently, what i'm doing is to write my own replacement function that
change the case like this:

(defun upcase-matched ()
  "Returns the upcase of matched text."
  (let (m1 returnText)
    (setq m1 (upcase (buffer-substring (match-beginning 1) (match-end
1))))
    (setq returnText (concat "<p>" m1 ))
    returnText
  )
)

then use “\,(upcase-matched)” for the replacement text.

PS I wrote a tutorial on this

 http://xahlee.org/emacs/emacs_find_replace.html

  Xah
  xah@xahlee.org
∑ http://xahlee.org/^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2008-03-13 19:50 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-13  3:12 force upper case of matched regex text pattern xahlee
2008-03-13  8:53 ` Andreas Röhler
     [not found] ` <mailman.8825.1205398225.18990.help-gnu-emacs@gnu.org>
2008-03-13 11:03   ` Xah
2008-03-13 17:42 ` Niels Giesen
2008-03-13 19:50   ` Xah Lee

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).