From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Greg Hill Newsgroups: gmane.emacs.help Subject: Re: capitalize string using regular expressions Date: Fri, 5 Dec 2003 19:29:35 -0800 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: <3M9Ab.324$vg4.207@nwrdny02.gnilink.net> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" ; format="flowed" X-Trace: sea.gmane.org 1070681464 8498 80.91.224.253 (6 Dec 2003 03:31:04 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 6 Dec 2003 03:31:04 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Dec 06 04:31:02 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AST9q-0007bQ-00 for ; Sat, 06 Dec 2003 04:31:02 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ASU79-0007Aw-Bc for geh-help-gnu-emacs@m.gmane.org; Fri, 05 Dec 2003 23:32:19 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1ASU6y-0007Ar-7U for help-gnu-emacs@gnu.org; Fri, 05 Dec 2003 23:32:08 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1ASU6S-0006vA-GC for help-gnu-emacs@gnu.org; Fri, 05 Dec 2003 23:32:07 -0500 Original-Received: from [153.105.4.30] (helo=synergymicro.com) by monty-python.gnu.org with esmtp (Exim 4.24) id 1ASU6R-0006o8-Od for help-gnu-emacs@gnu.org; Fri, 05 Dec 2003 23:31:35 -0500 Original-Received: from synergy.synergy.encinitas.ca.us (renfield-dmz-gateway [153.105.4.29]) by synergymicro.com (8.9.3/8.9.3) with ESMTP id TAA11056 for ; Fri, 5 Dec 2003 19:33:41 -0800 Original-Received: from [10.1.4.35] ([10.1.4.35]) by synergy.synergy.encinitas.ca.us (8.12.8/8.12.8) with ESMTP id hB63VPRv032249 for ; Fri, 5 Dec 2003 19:31:25 -0800 In-Reply-To: <3M9Ab.324$vg4.207@nwrdny02.gnilink.net> Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:14996 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:14996 At 12:53 AM +0000 12/6/03, colin smith wrote: > Does anyone know how I can replace all occurences of any strings that >end with ".txt" (lets say "ghjkl.txt" and "xyz.txt") with their uppercase >equivalents(ie. "GHJKL.txt" and "XYZ.txt"). There must be some way of doing >this using regular expressions. I've looked extensively through the emacs >help, but havent been able to figure it out. (while (re-search-forward "\\W\\(\\w+\\)\\.txt\\W" nil t) (replace-match (upcase (match-string-no-properties 1)) nil nil nil 1))) --Greg