From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.help Subject: RE: regex nirvana - near miss Date: Thu, 26 Jun 2014 09:35:54 -0700 (PDT) Message-ID: <02623a62-1f59-4fc5-8e34-6d28aa4a7013@default> References: <27747b$8snl6c@ironport10.mayo.edu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1403800596 7063 80.91.229.3 (26 Jun 2014 16:36:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 26 Jun 2014 16:36:36 +0000 (UTC) To: "Buchs, Kevin J." , help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Jun 26 18:36:29 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 1X0Cex-0002NK-I3 for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jun 2014 18:36:27 +0200 Original-Received: from localhost ([::1]:45961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Cex-0003L4-7R for geh-help-gnu-emacs@m.gmane.org; Thu, 26 Jun 2014 12:36:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59454) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0Cee-0003K3-3S for help-gnu-emacs@gnu.org; Thu, 26 Jun 2014 12:36:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X0CeU-0006kW-SD for help-gnu-emacs@gnu.org; Thu, 26 Jun 2014 12:36:08 -0400 Original-Received: from aserp1040.oracle.com ([141.146.126.69]:17834) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X0CeU-0006kE-M3 for help-gnu-emacs@gnu.org; Thu, 26 Jun 2014 12:35:58 -0400 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s5QGZtum030264 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Jun 2014 16:35:56 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5QGZsYG010698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 26 Jun 2014 16:35:55 GMT Original-Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s5QGZs95010690; Thu, 26 Jun 2014 16:35:54 GMT In-Reply-To: <27747b$8snl6c@ironport10.mayo.edu> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8 (707110) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 141.146.126.69 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:98418 Archived-At: > 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.