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

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

force upper case of matched regex text pattern


From: address@hidden
Subject: force upper case of matched regex text pattern
Date: Wed, 12 Mar 2008 20:12:15 -0700 (PDT)
User-agent: G2/1.0

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/

reply via email to

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