From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tassilo Horn Newsgroups: gmane.emacs.help Subject: Re: does emacs regular expression support (?!expression) Date: Thu, 02 Feb 2012 22:45:04 +0100 Message-ID: <87ipjo52qn.fsf@thinkpad.tsdh.de> References: <8739at5aj0.fsf@thinkpad.tsdh.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1328219136 4107 80.91.229.3 (2 Feb 2012 21:45:36 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 2 Feb 2012 21:45:36 +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 Feb 02 22:45: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 1Rt4TH-0000Zl-Ck for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Feb 2012 22:45:35 +0100 Original-Received: from localhost ([::1]:56993 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4TG-0006ER-Vp for geh-help-gnu-emacs@m.gmane.org; Thu, 02 Feb 2012 16:45:34 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:39735) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4T6-0006DG-T2 for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:45:28 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rt4T3-0006w5-1K for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:45:24 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:51477) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rt4T2-0006vx-RL for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 16:45:20 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Rt4Sy-0000LI-JV for help-gnu-emacs@gnu.org; Thu, 02 Feb 2012 22:45:16 +0100 Original-Received: from 91-67-11-43-dynip.superkabel.de ([91.67.11.43]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Feb 2012 22:45:16 +0100 Original-Received: from tassilo by 91-67-11-43-dynip.superkabel.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 02 Feb 2012 22:45:16 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 23 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 91-67-11-43-dynip.superkabel.de User-Agent: Gnus/5.130002 (Ma Gnus v0.2) Emacs/24.0.93 (gnu/linux) Cancel-Lock: sha1:e79n34f0Q9pwuskoVHjU0rrbiYw= 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:83589 Archived-At: Tim Landscheidt writes: Hi Tim, >> It would be more helpful if you'd tell us what (?!expression) would >> match, preferably with some examples. Syntactically, emacs regexp's shy >> groups look similar. The regular expression > >> "\\(:?foo\\|bar\\)\\([0-9]+\\)" BTW, that should have been (?:...). >> matches "foo19" or "bar23", but doesn't capture foo or bar, so that >> (match-string 1) is the number. > > 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. Bye, Tassilo