From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: henry atting Newsgroups: gmane.emacs.help Subject: Re: rexexp help needed Date: Fri, 26 Dec 2008 17:17:49 +0100 Message-ID: <87myeix64y.fsf@literaturlatenight.de> References: <87bpuzaugu.fsf@literaturlatenight.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1230308136 29556 80.91.229.12 (26 Dec 2008 16:15:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Dec 2008 16:15:36 +0000 (UTC) Cc: henry atting , help-gnu-emacs@gnu.org To: "Lennart Borgman" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Dec 26 17:16:43 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LGFMh-0003jj-GG for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Dec 2008 17:16:43 +0100 Original-Received: from localhost ([127.0.0.1]:40415 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LGFLU-0008IZ-A0 for geh-help-gnu-emacs@m.gmane.org; Fri, 26 Dec 2008 11:15:28 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LGFL9-0008IK-2p for help-gnu-emacs@gnu.org; Fri, 26 Dec 2008 11:15:07 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LGFL6-0008I4-LL for help-gnu-emacs@gnu.org; Fri, 26 Dec 2008 11:15:05 -0500 Original-Received: from [199.232.76.173] (port=59726 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LGFL6-0008I1-FC for help-gnu-emacs@gnu.org; Fri, 26 Dec 2008 11:15:04 -0500 Original-Received: from mout-xforward.kundenserver.de ([212.227.17.4]:61045) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LGFL5-0002mo-V0 for help-gnu-emacs@gnu.org; Fri, 26 Dec 2008 11:15:04 -0500 Original-Received: from argon (port-92-195-73-213.dynamic.qsc.de [92.195.73.213]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1LGFL00dGn-0007Xr; Fri, 26 Dec 2008 17:14:58 +0100 Original-Received: by argon (Postfix, from userid 1000) id 67AA7339CC; Fri, 26 Dec 2008 17:17:49 +0100 (CET) In-Reply-To: (Lennart Borgman's message of "Fri, 26 Dec 2008 15:51:25 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Provags-ID: V01U2FsdGVkX1/m6kHR9/N30Runm591LGoSJJoLT33anCjcp5U S9yMjZoAl0F2aiqKPTZP5p7imEop6X8YdsA03Gs+eADKQKDpLT 3lq8DnnMPPv5J+h8n0oTA== X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:60934 Archived-At: Zitat - Lennart Borgman * Fr Dez 26 2008 um 15:51 - > On Fri, Dec 26, 2008 at 3:20 PM, henry atting > wrote: >> Hi, >> >> I am trying to build a rexexp that does the following: >> I have a text file where I want to replace >> >> Medicine:One:Two =E2=82=AC12.00 >> >> With >> >> Medicine =E2=82=AC12.00 >> >> Because I have more than one entry `Medicine' (and they >> differ slightly, something like `Medicine:Three:Four' and >> so on) I have to do it with `quere-replace-regexp'. >> With regexp-builder I found this: >> >> Medicine:.*[^=E2=82=AC.0-9] >> >> This works both in regexp-builder and a scratch buffer, but >> unfortunately not in a file. If applied on a file replace-regexp >> strips everything from the first `:'. > > You have to escape the [] with \. That is a bit tricky since you have > to double the escape character. (One for text escaping, one for regexp > char escaping.) Mmh, IIRC I tried it already with escape sequences. Anyway, if I do so I get: Replaced 0 occurences No difference if I try it in a scratch buffer or a file. Without escaping it works in a scratch buffer at least. ;)