From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Thierry Volpiatto Newsgroups: gmane.emacs.help Subject: Re: Then how to replace all my $$ ... $$ to \[ \] through search and replace? Date: Fri, 15 Aug 2008 11:08:02 +0200 Message-ID: <87abfeodcd.fsf@tux.homenetwork> References: <48a540fe$0$11744$9b4e6d93@newsspool1.arcor-online.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1218791509 9533 80.91.229.12 (15 Aug 2008 09:11:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 Aug 2008 09:11:49 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 15 11:12:41 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 1KTvMM-000591-TC for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Aug 2008 11:12:39 +0200 Original-Received: from localhost ([127.0.0.1]:43417 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTvLQ-0006ml-3g for geh-help-gnu-emacs@m.gmane.org; Fri, 15 Aug 2008 05:11:40 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KTvKu-0006l2-IN for help-gnu-emacs@gnu.org; Fri, 15 Aug 2008 05:11:08 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KTvKs-0006jJ-62 for help-gnu-emacs@gnu.org; Fri, 15 Aug 2008 05:11:07 -0400 Original-Received: from [199.232.76.173] (port=39532 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KTvKr-0006it-QP for help-gnu-emacs@gnu.org; Fri, 15 Aug 2008 05:11:05 -0400 Original-Received: from ug-out-1314.google.com ([66.249.92.170]:19787) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KTvKq-0002hm-Ql for help-gnu-emacs@gnu.org; Fri, 15 Aug 2008 05:11:05 -0400 Original-Received: by ug-out-1314.google.com with SMTP id s2so261424uge.6 for ; Fri, 15 Aug 2008 02:11:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:references :date:in-reply-to:message-id:user-agent:mime-version:content-type; bh=vnY6XpMYlxRZmUBKrpkes2it52u2KiT0yC2rdn6Hkuk=; b=ay9X9d31ALrcHX8uV4kAwgNoc7s9QHyPeRD4P/ZM43+Vds5eUu12Vo8ROV2mffDSaU niy5gFJM12OJcZ3i/oQU3QCoysyGZvaLyNPPXpOFGG15A5Dh68fg4ZgHb/KtpfCyNz2N lTLPgwjT82rQMlRFBB5umQWzWIMsXQnVCsnik= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type; b=jCTxGXyR1CXAhQmTlE3p3VYpON/lU+ivKiHtCF35xnaoxdDwTBSYXgQxwWkrff2fks ENGrlSRydUiZPgxmtQCT/K/Ks9rOyAKgW5mlrUx5vln3dLlHGVsyio6swNOerxsKvAbU TuYqerpzf//BDYsfAPZB9BEPSycDzLUFaPbTE= Original-Received: by 10.67.119.8 with SMTP id w8mr333945ugm.20.1218791463134; Fri, 15 Aug 2008 02:11:03 -0700 (PDT) Original-Received: from tux.homenetwork ( [77.197.77.49]) by mx.google.com with ESMTPS id 40sm452616uge.62.2008.08.15.02.11.00 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 15 Aug 2008 02:11:01 -0700 (PDT) In-Reply-To: <48a540fe$0$11744$9b4e6d93@newsspool1.arcor-online.net> (Ralf Angeli's message of "Fri, 15 Aug 2008 10:40:30 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Linux 2.6 (newer, 2) 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:56662 Archived-At: Ralf Angeli writes: > * Tassilo Horn (2008-08-15) writes: > >> "xiaopeng hu" writes: >> >>> Then how to replace all my $$ ... $$ to \[ \] through search and >>> replace? Thanks >> >> M-x query-replace-regexp RET \$\$\(.+\)\$\$ RET \\[\1\\] RET > > This won't work because `.' does not match a newline. Using `[^$]' > instead should do it. Just a note about re-builder and regex-tool: To build a regex to use in a program or with query-replace-regexp, you can use one of these tools, however, re-builder will build a regex to use in a program and this regex will not work in query-replace-regexp. Regex-tool will build a regex more usable with query-replace-regexp. [0-9]\\{2\\} ==> work in a program but not in query-replace [0-9]\{2\} ==> work in query-replace but not in a program -- A + Thierry Volpiatto Location: Saint-Cyr-Sur-Mer - France