Hi Rich,

>    Now I need to do ther reverse: remove quotes around digits to convert a
> string to a number. I've tried the above adding quotes to the query string
> and removing them from the replacement string, but that leaves the string
> unchanged. I've also tried other variants with equal lack of success.

Doing the opposite seems to be working for me.  Specifically (I used a
simpler example):

M-x replace-regexp
query = '\([0-9][0-9][0-9]\)'
replace = \1

Can you send an example of the before/after text you have/want?  The
query can be made to work with arbitrarily sized numbers, which could
be part of the problem.  (This example will *only* find 3-digit
numbers.)

--Rogan

On Mon, Oct 15, 2012 at 10:19 AM, Rich Shepard <[email protected]> wrote:
>    About a year ago Rogan taught me how to add quotes to a date string:
>
> M-x replace-regexp
> query = \([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]\)
> replace = '\1'
>
>    Now I need to do ther reverse: remove quotes around digits to convert a
> string to a number. I've tried the above adding quotes to the query string
> and removing them from the replacement string, but that leaves the string
> unchanged. I've also tried other variants with equal lack of success.
>
>    My Google searches turn up a emacs wiki page that has the code to remove
> all quotes around strings; I need to do this to only quoted numeric strings
> in each line of a file.
>
>    A clue on how to do this is needed.
>
> TIA,
>
> Rich
>
>
>
>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to