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

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

Re: regex nirvana - near miss


From: Stefan Monnier
Subject: Re: regex nirvana - near miss
Date: Thu, 26 Jun 2014 11:38:27 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> Often I wish to match a string not followed by another string, e.g. "abc"
> without "def" following.

Indeed, negation is sorely lacking from Emacs's regexps.

BTW, the notion of negation in regexps is not quite as simple as it
sounds.  E.g. regexps supported by lex.el (in GNU ELPA) do include
a negation operator, but not the one you want: (seq "abc" (not "def"))
will happily match "abcdefg" (stopping at "abc", "abcd", "abcde", or
"abcdefg").


        Stefan


reply via email to

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