From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: regex nirvana - near miss Date: Thu, 26 Jun 2014 11:38:27 -0400 Organization: A noiseless patient Spider Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1403797234 28150 80.91.229.3 (26 Jun 2014 15:40:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Jun 2014 15:40:34 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 26 17:40:28 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1X0Bml-0007KI-1j for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jun 2014 17:40:27 +0200 Original-Received: from localhost ([::1]:45511 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Bmk-0004zM-MH for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jun 2014 11:40:26 -0400 Original-Path: usenet.stanford.edu!news.kjsl.com!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 13 Injection-Info: mx05.eternal-september.org; posting-host="80f6b1c01f068ad28ca734314fbfaa28"; logging-data="16452"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g/V1naLxfPxh99/FyMwRp" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) Cancel-Lock: sha1:ZZSiojCZTmkHza2KK6kY1mBN+Y8= sha1:FOisycOieswlohLxSgMnNfyJDv4= Original-Xref: usenet.stanford.edu gnu.emacs.help:206145 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:98416 Archived-At: > 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