From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: cinsk Newsgroups: gmane.emacs.help Subject: Re: efficient regular expression that never matches Date: Fri, 20 Nov 2015 21:52:43 -0800 (PST) Message-ID: <2929ffa3-d339-43c3-84e8-2211dcc53695@googlegroups.com> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1448085327 25259 80.91.229.3 (21 Nov 2015 05:55:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Nov 2015 05:55:27 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Nov 21 06:55:19 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 1a018o-0002Fz-EY for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 06:55:18 +0100 Original-Received: from localhost ([::1]:51168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a018n-00087u-O0 for geh-help-gnu-emacs@m.gmane.org; Sat, 21 Nov 2015 00:55:17 -0500 X-Received: by 10.13.204.194 with SMTP id o185mr15450882ywd.55.1448085164095; Fri, 20 Nov 2015 21:52:44 -0800 (PST) X-Received: by 10.50.57.84 with SMTP id g20mr150526igq.3.1448085164052; Fri, 20 Nov 2015 21:52:44 -0800 (PST) Original-Path: usenet.stanford.edu!f78no1132550qge.1!news-out.google.com!l1ni4208igd.0!nntp.google.com!mv3no22112igc.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=220.120.113.95; posting-account=njEU7goAAACogg_6wI_bgyzQXAw4yM6w Original-NNTP-Posting-Host: 220.120.113.95 User-Agent: G2/1.0 Injection-Date: Sat, 21 Nov 2015 05:52:44 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:215885 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:108173 Archived-At: On Saturday, November 21, 2015 at 12:59:51 AM UTC+9, John Wiegley wrote: > >>>>> Stefan Monnier writes: >=20 > >> I'm thinking of "$a", but it should scan all the string until end of t= he > >> string, so it may not be efficient. >=20 > > IIRC I used something like "\\`\\'a". >=20 > Yes, also because "$" only has special meaning as the last character of t= he > regexp, whereas \\' should always mean "end of ". >=20 > John Yes, I agree with that, However, "$a" means that the regular expression engine may read all strings= until the end of the line. So, if I can do something like "^", then the engine should detect before reading = all characters of the line, I presume. Perhaps "^\uFFFFF" can be a solutio= n? Since \uFFFF is noncharacter of the unicode (\uFFFF can be use for the = internal purpose but generally not used.)