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: Drew Adams
Subject: RE: regex nirvana - near miss
Date: Thu, 26 Jun 2014 09:35:54 -0700 (PDT)

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

Typically, what you want to do for this in Emacs Lisp is to combine
the use of a regexp for positive matching with other code that takes
care of the non-matching (negation) need.

For example, you want to find a match for `abc' that does not also
match `def' at the `abc' match end.  Search for `abc', and then
programmatically exclude search hits where `def' follows `abc'.

Or if you want to complement a set of regexp matches, compute it
and then subtract it from the original search space.



reply via email to

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