Article View: fj.editor.mule
Article #236Re: how to replace aa_bcd with aaBcd
From: Katsumi Yamaoka
Date: Thu, 27 Jun 2002 01:57
Date: Thu, 27 Jun 2002 01:57
31 lines
2343 bytes
2343 bytes
>>>>> In <x5u1nvy616.fsf@civilnet.kuciv.kyoto-u.ac.jp>
>>>>> SHIIBA Michiharu <shiiba@civilnet.kuciv.kyoto-u.ac.jp> wrote:
ๆค่ใใ> query-replace-regexp ใซ้ขใใ่ณชๅใงใใ
ๆค่ใใ> (defun foo ()
ๆค่ใใ> (interactive)
ๆค่ใใ> (query-replace-regexp "\\(\\w\\)_\\(\\w\\)" "\\1\\2")))
[...]
ๆค่ใใ> aaBcd, fooBar
ๆค่ใใ> ใฎใใใซใชใใใใซใใใซใฏใๅ
ใฎ้ขๆฐ foo ใใฉใฎใใใซๆธใๅค
ๆค่ใใ> ใใใฐใใใงใใใใใ
query-replace-regexp ใ ใใงใฏใใถใ็ก็ใงใใใใใชๆใใงใใใใ?
(defun foo2 ()
(interactive)
(let (old new)
(while (re-search-forward "\\(\\w+\\)_\\(\\w+\\)" nil t)
(setq old (match-string 0)
new (concat (match-string 1)
(capitalize (match-string 2))))
(if (y-or-n-p (concat "Query replacing \"" old
"\" with \"" new "\" "))
(replace-match new)))
(message "done")))
--
ๅฑฑๅฒก
Technical Details
Message-ID:
<yotln0thfpps.fsf@jpl.org>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!groundpoundrecords.COM!not-for-mailReferences:
<x5u1nvy616.fsf@civilnet.kuciv.kyoto-u.ac.jp>Show Full Headers
Complete Article Headers
X-Google-Language: Japanese,JIS X-Google-Thread: 10eba4,8ddef165b089fd8e X-Google-Attributes: gid10eba4,public X-Google-ArrivalTime: 2002-06-26 18:57:51 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!fu-berlin.de!uni-berlin.de!groundpoundrecords.COM!not-for-mail From: Katsumi Yamaoka <yamaoka@jpl.org> Newsgroups: fj.editor.mule Subject: Re: how to replace aa_bcd with aaBcd Date: Thu, 27 Jun 2002 10:57:34 +0900 Organization: Emacsen advocacy group Lines: 31 Message-ID: <yotln0thfpps.fsf@jpl.org> References: <x5u1nvy616.fsf@civilnet.kuciv.kyoto-u.ac.jp> NNTP-Posting-Host: groundpoundrecords.com (207.228.244.150) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-2022-JP X-Trace: fu-berlin.de 1025143068 14544605 207.228.244.150 (16 [27265]) User-Agent: T-gnus/6.15.7 (based on Oort Gnus v0.07) (revision 02) MULE/2.3 (ๆซๆ่ฑ) (based on Emacs 19.34) WEMIKO/1.14.1 (่ฅ้ญๆฏ่ซ) CLIME/1.14.4 (่ชๅ่ป้ฃ็ตก) APEL/10.3 X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( Cancel-Lock: sha1:YZlv7k+nLwyC4YaDZDcejuN7O7c= X-Hashcash: 020627:fj.editor.mule:27cb3bdfd236a39f