🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: fj.editor.mule
Article #237

Re: how to replace aa_bcd with aaBcd

#237
From: SHIIBA Michiharu
Date: Mon, 01 Jul 2002 02:30
32 lines
1906 bytes
$B;32,MM(B

$B$"$j$,$H$&$4$6$$$^$7$?!#(B

$B;32,MM(B> query-replace-regexp $B$@$1$G$O$?$V$sL5M}$G$9!#$3$s$J46$8$G$7$g$&$+(B?

$B;32,MM(B> (defun foo2 ()
$B;32,MM(B>   (interactive)
$B;32,MM(B>   (let (old new)
$B;32,MM(B>     (while (re-search-forward "\\(\\w+\\)_\\(\\w+\\)" nil t)
$B;32,MM(B>       (setq old (match-string 0)
$B;32,MM(B> 	    new (concat (match-string 1)
$B;32,MM(B> 			(capitalize (match-string 2))))
$B;32,MM(B>       (if (y-or-n-p (concat "Query replacing \"" old
$B;32,MM(B> 			    "\" with \"" new "\" "))
$B;32,MM(B> 	  (replace-match new)))
$B;32,MM(B>     (message "done")))

foo_bar_aho $B$J$I$KBP1~$9$k$?$a$K!"(B

	  (replace-match new)

$B$r(B
          (progn
  	    (replace-match new)
            (backward-char 1))

$B$H$7$F;H$&$3$H$K$7$^$7$?!#$I$&$b$"$j$,$H$&$4$6$$$^$7$?!#(B            


-- 
$BDGMU(B $B=<@2(B (Michiharu CBAR)
Technical Details
Message-ID: <x5hejkch8a.fsf@civilnet.kuciv.kyoto-u.ac.jp>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news.media.kyoto-u.ac.jp!not-for-mail
References: <x5u1nvy616.fsf@civilnet.kuciv.kyoto-u.ac.jp> <yotln0thfpps.fsf@jpl.org>

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-30 19:10:18 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!news.media.kyoto-u.ac.jp!not-for-mail
From: SHIIBA Michiharu <shiiba@civilnet.kuciv.kyoto-u.ac.jp>
Newsgroups: fj.editor.mule
Subject: Re: how to replace aa_bcd with aaBcd
Date: 01 Jul 2002 11:30:29 +0900
Organization: Public NNTP Service, Kyoto University, JAPAN
Lines: 32
Message-ID: <x5hejkch8a.fsf@civilnet.kuciv.kyoto-u.ac.jp>
References: <x5u1nvy616.fsf@civilnet.kuciv.kyoto-u.ac.jp>
 <yotln0thfpps.fsf@jpl.org>
NNTP-Posting-Host: wr.kuciv.kyoto-u.ac.jp
X-Trace: ginger.media.kyoto-u.ac.jp 1025489418 18440 130.54.249.158 (1 Jul 2002 02:10:18 GMT)
X-Complaints-To: usenet@news.media.kyoto-u.ac.jp
NNTP-Posting-Date: 1 Jul 2002 02:10:18 GMT
X-Newsreader: Gnus v5.3/Emacs 19.34