On Fri, Jan 28, 2011 at 8:56 AM, Rich Shepard <rshep...@appl-ecosys.com> wrote:
>   I want to globally replace a digit followed by a single quotation mark by
> the digit alone. Using emacs's regex I set the search term as [0-9]' and the
> replace term as \&. The replace term replaces the single quote, too. I
> cannot do a regular search-and-replace for single quotes because there are
> strings defined.
>

You need to define a group around the digit, then reference that digit
as the replace pattern, using query-replace-regexp.  Match on:

\([0-9]\)'

and replace with:

\1

(to refer to the first group)

http://www.gnu.org/software/findutils/manual/html_node/find_html/emacs-regular-expression-syntax.html

--Rogan


>   How do I write the replacement term so only the digit is written and the
> single quote eliminated?
>
> Rich
> _______________________________________________
> PLUG mailing list
> PLUG@lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
_______________________________________________
PLUG mailing list
PLUG@lists.pdxlinux.org
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to