From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kevin Rodgers Newsgroups: gmane.emacs.help Subject: Re: does emacs regular expression support (?!expression) Date: Thu, 02 Feb 2012 17:37:57 -0700 Message-ID: References: <8739at5aj0.fsf@thinkpad.tsdh.de> <87ipjo52qn.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1328229455 7586 80.91.229.3 (3 Feb 2012 00:37:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 3 Feb 2012 00:37:35 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Feb 03 01:37:35 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Rt79i-0001Si-Vv for geh-help-gnu-emacs@m.gmane.org; Fri, 03 Feb 2012 01:37:35 +0100 Original-Received: from localhost ([::1]:55216 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt79i-0003If-FV for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Feb 2012 19:37:34 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:40506) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt79Z-0003I4-I3 for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 19:37:29 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt79V-0005Ea-Gi for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 19:37:25 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:49419) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt79V-0005EW-AK for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 19:37:21 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rt79J-0001Jo-MG for help-gnu-emacs@gnu.org; Fri, 03 Feb 2012 01:37:09 +0100 Original-Received: from c-71-237-25-24.hsd1.co.comcast.net ([71.237.25.24]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Feb 2012 01:37:09 +0100 Original-Received: from kevin.d.rodgers by c-71-237-25-24.hsd1.co.comcast.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 03 Feb 2012 01:37:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 17 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: c-71-237-25-24.hsd1.co.comcast.net User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.4; en-US; rv:1.9.2.26) Gecko/20120129 Thunderbird/3.1.18 In-Reply-To: <87ipjo52qn.fsf@thinkpad.tsdh.de> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:83593 Archived-At: On 2/2/12 2:45 PM, Tassilo Horn wrote: > Tim Landscheidt writes: >> In Perl, "(?!pattern)" is a zero-width negative look-ahead >> assertion. Emacs does not support these AFAIK. > > I see. So when you do /foo(?!bar)/ in Perl, you'd need to do > "foo\\(?:[^b][^a][^r]\\)" in elisp. IIUC, the Perl regex would successfully match "foo" if it were followed by "far", but the Emacs regexp would not. Maybe \(?:[^b][^a][^r]\) should be \(?:[^b]\|b[^a]\|ba[^r]\) -- Kevin Rodgers Denver, Colorado, USA