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

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

Re: non word abbrevs


From: tomas
Subject: Re: non word abbrevs
Date: Mon, 1 Nov 2021 15:03:23 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, Nov 01, 2021 at 10:17:28PM +0900, Jean-Christophe Helary wrote:
> 
> 
> > On Nov 1, 2021, at 21:43, Stefan Monnier via Users list for the GNU Emacs 
> > text editor <help-gnu-emacs@gnu.org> wrote:

[...]

> >> :regexp "\\([<>=-]+\\)"

Oh, yes: always double your backslashes (well /nearly/ [1] always).
The first ones are for Lisp's string syntax.

[...]

> In a different world, I'd try [<>=-]{2,3}

Emacs is your world, then. Well, nearly :) It groks {} repetitions
(cf. the docs). Note that they are spelt with a backslash (don't
forget to double it in string context). This would give:

      "...[<>=-]\\{2,3\\}..."

in your case (the dots are ellipses, for the rest of your regexp).

Cheers

[1] When you are writing the regexp in a Lisp string. Not when
   you are entering it interactively, e.g. in the minibuffer.

 - t

Attachment: signature.asc
Description: Digital signature


reply via email to

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