help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: does emacs regular expression support (?!expression)


From: Kevin Rodgers
Subject: Re: does emacs regular expression support (?!expression)
Date: Thu, 02 Feb 2012 17:37:57 -0700
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

On 2/2/12 2:45 PM, Tassilo Horn wrote:
Tim Landscheidt<tim@tim-landscheidt.de>  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




reply via email to

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