[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Emacs regexp problem
From: |
Joel J. Adamson |
Subject: |
Re: Emacs regexp problem |
Date: |
Tue, 29 Jan 2008 14:20:24 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) |
"mailpitches@email.com" <mailpitches@email.com> writes:
[...]
> func(param) should be converted to func('param')
>
> I use the following command:
> M-x replace-regexp [enter] get\((.*)\) [enter] get('\1')) [enter]
>
> and the result is func(param) is converted to func('(param)')
>
> Why are those extra parentheses appearing in there
They're your parentheses: in emacs \(...\) makes groups, rather than
(...), so your second un-escaped set of parentheses is getting matched
and ending up in the replacement ('\1').
> ; is this an error on emacs' part?
Not really ;)
Joel
--
Joel J. Adamson
Biostatistician
Pediatric Psychopharmacology Research Unit
Massachusetts General Hospital
Boston, MA 02114
(617) 643-1432
(303) 880-3109