From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: luishenriquezperez@gmail.com Newsgroups: gmane.emacs.help Subject: Negative Lookahead Equivalent in emacs Date: Mon, 8 May 2017 22:15:42 -0700 (PDT) Message-ID: <49e1dd7d-4be5-4b03-b9e2-e26b15b0a6cb@googlegroups.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1494307258 6343 195.159.176.226 (9 May 2017 05:20:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 9 May 2017 05:20:58 +0000 (UTC) Injection-Date: Tue, 09 May 2017 05:15:44 +0000 User-Agent: G2/1.0 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue May 09 07:20:55 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d7xZu-0001XA-U3 for geh-help-gnu-emacs@m.gmane.org; Tue, 09 May 2017 07:20:55 +0200 Original-Received: from localhost ([::1]:35001 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d7xZy-0000ua-TV for geh-help-gnu-emacs@m.gmane.org; Tue, 09 May 2017 01:20:58 -0400 X-Received: by 10.99.115.27 with SMTP id o27mr10230023pgc.164.1494306944264; Mon, 08 May 2017 22:15:44 -0700 (PDT) X-Received: by 10.157.17.23 with SMTP id g23mr1201167ote.4.1494306944180; Mon, 08 May 2017 22:15:44 -0700 (PDT) Original-Path: usenet.stanford.edu!c26no1650052itd.0!news-out.google.com!v18ni2640ita.0!nntp.google.com!c26no1655969itd.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Complaints-To: groups-abuse@google.com Original-Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:18d:4700:a0f0:9d25:2f9b:2ae0:f1a4; posting-account=1FnN2QoAAADplQTXU-CDH-RVhjZBEjLX Original-NNTP-Posting-Host: 2601:18d:4700:a0f0:9d25:2f9b:2ae0:f1a4 Original-Xref: usenet.stanford.edu gnu.emacs.help:219111 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:112971 Archived-At: Hi, I'm trying to write a regex that matches the last character of a sequence o= f non-whitespace characters '[^\n\r\t\f ]', or an empty line matching ^$.= =20 Thus:=20 Hello World! --> "o" and "!" would be matched In non-elisp regex languages I know the code for this is: \S(?!\S)=20 I know that \S is equivalent too [^ /n/r/t/f].=20 But I'm unsure of what the elisp equivalent (if any) of the negative lookah= ead (?!). I saw on this forum a post "gnu.emacs.help =E2=80=BA regex nirvana - near = miss" Where Drew Adams said: "Typically, what you want to do for this in Emacs Li= sp is to combine=20 the use of a regexp for positive matching with other code that takes=20 care of the non-matching (negation) need. " However, I'm not sure how to go about doing this.