help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Then how to replace all my $$ ... $$ to \[ \] through search and rep


From: Thierry Volpiatto
Subject: Re: Then how to replace all my $$ ... $$ to \[ \] through search and replace?
Date: Fri, 15 Aug 2008 11:08:02 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

Ralf Angeli <address@hidden> writes:

> * Tassilo Horn (2008-08-15) writes:
>
>> "xiaopeng hu" <address@hidden> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]