From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: John Wiegley Newsgroups: gmane.emacs.help Subject: Re: efficient regular expression that never matches Date: Fri, 20 Nov 2015 07:59:39 -0800 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1448035206 24719 80.91.229.3 (20 Nov 2015 16:00:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 20 Nov 2015 16:00:06 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Stefan Monnier Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Nov 20 17:00:02 2015 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 1Zzo6R-0007Lx-ML for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Nov 2015 16:59:59 +0100 Original-Received: from localhost ([::1]:48235 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zzo6R-0007he-46 for geh-help-gnu-emacs@m.gmane.org; Fri, 20 Nov 2015 10:59:59 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52586) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zzo6D-0007hX-It for help-gnu-emacs@gnu.org; Fri, 20 Nov 2015 10:59:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zzo6A-0001w3-Ci for help-gnu-emacs@gnu.org; Fri, 20 Nov 2015 10:59:45 -0500 Original-Received: from mail-pa0-x22e.google.com ([2607:f8b0:400e:c03::22e]:34815) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zzo6A-0001vx-7o for help-gnu-emacs@gnu.org; Fri, 20 Nov 2015 10:59:42 -0500 Original-Received: by padhx2 with SMTP id hx2so120201923pad.1 for ; Fri, 20 Nov 2015 07:59:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:in-reply-to:date:message-id:references :user-agent:mail-followup-to:mime-version:content-type; bh=4Qp/qB73lalsMBvDYWCc7+fksHnoiKmVli2hcy/b6hU=; b=K7Lr68qde+fuaUD/ebvoWd3323bTQtsBtFeae0gjX2yuUFBwzx1pA8CSg2qwq7Fej7 Ojkacx9+JAN/HYIxNQ+cM3ymRr5Ni8HOtxVWKLP4W27ePYr9Ytf/nxe2DHOPFyitJh8l LqxN5PSBN8XdwB6Xjqr1UXLk81oohghZ809W+lH1TS5uNZk+cFTT67R0Nk7VYh959Vje dkUQqup/taBDT9mWsodw9U5+hvnJpVIzhAuNpEHiX+8PdeK5g4cu65ViFSSGbLQcEASs iFmwuVo1AP71RD4s6SKdcMiuxCXtCmTMYx6ubii3DsMmxKFFqKc4dFjTQ8PF1Ula3qPJ p3uw== X-Received: by 10.68.224.106 with SMTP id rb10mr9948201pbc.17.1448035181647; Fri, 20 Nov 2015 07:59:41 -0800 (PST) Original-Received: from Vulcan.local (76-234-68-79.lightspeed.frokca.sbcglobal.net. [76.234.68.79]) by smtp.gmail.com with ESMTPSA id zg4sm188322pbc.23.2015.11.20.07.59.40 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 20 Nov 2015 07:59:41 -0800 (PST) X-Google-Original-From: "John Wiegley" Original-Received: by Vulcan.local (Postfix, from userid 501) id 702FC10A57902; Fri, 20 Nov 2015 07:59:40 -0800 (PST) In-Reply-To: (Stefan Monnier's message of "Fri, 20 Nov 2015 10:13:11 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) Mail-Followup-To: Stefan Monnier , help-gnu-emacs@gnu.org X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c03::22e 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:108168 Archived-At: >>>>> Stefan Monnier writes: >> I'm thinking of "$a", but it should scan all the string until end of the >> string, so it may not be efficient. > IIRC I used something like "\\`\\'a". Yes, also because "$" only has special meaning as the last character of the regexp, whereas \\' should always mean "end of ". John