๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.editor.mule
Article #236

Re: how to replace aa_bcd with aaBcd

#236
From: Katsumi Yamaoka
Date: Thu, 27 Jun 2002 01:57
31 lines
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-mail
References: <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