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

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

Re: Replace all occurrences of a specific character with another.


From: Hongyi Zhao
Subject: Re: Replace all occurrences of a specific character with another.
Date: Sun, 23 Jul 2023 08:36:25 +0800

On Sat, Jul 22, 2023 at 11:08 PM PierGianLuca
<luca@magnaspesmeretrix.org> wrote:
>
> It looks like your character appears surrounded by non-letters in every 
> instance. In this case you could use `query-replace-regexp` replacing
>
> \<d\>
>
> with
>
> n
>
> The "\<\>" brackets match beginning and end of words:
>
> https://www.gnu.org/software/emacs/manual/html_node/emacs/Regexp-
> Backslash.html
>
>
> Your character also seems to appear inside maths expressions only. In this 
> case you could use the function defined in this post:
>
> http://stackoverflow.com/questions/19845598/emacs-regex-replacing-a-string-inside-a-latex-equation

Thank you for the nice tip, but there are several versions of
functions suggested there. So, which one is your preferred version?

> it's very useful and I use it regularly in LaTeX documents.
>
> Cheers,
> Luca

Regards,
Zhao

> On 230722 16:35, Hongyi Zhao wrote:
> > Hi here,
> >
> > I want to replace all occurrences of a specific character, say, `d`,
> > as shown in the attached screenshot, with another character, e.g.,
> > `n`. Is there any practical way to do this?
> >
> > Regards,
> > Zhao



reply via email to

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