all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: cinsk <cinsky@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: efficient regular expression that never matches
Date: Fri, 20 Nov 2015 21:52:43 -0800 (PST)	[thread overview]
Message-ID: <2929ffa3-d339-43c3-84e8-2211dcc53695@googlegroups.com> (raw)
In-Reply-To: <mailman.342.1448035187.31583.help-gnu-emacs@gnu.org>

On Saturday, November 21, 2015 at 12:59:51 AM UTC+9, John Wiegley wrote:
> >>>>> Stefan Monnier <monnier at iro.umontreal.ca> 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 <context>".
> 
> 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 "^<SOME CHARACTER OR CONDITION IMPOSSIBLE>", then the engine should detect before reading all characters of the line, I presume.  Perhaps "^\uFFFFF" can be a solution?  Since \uFFFF is noncharacter of the unicode (\uFFFF can be use for the internal purpose but generally not used.)


  parent reply	other threads:[~2015-11-21  5:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-20  9:35 efficient regular expression that never matches cinsk
2015-11-20 15:13 ` Stefan Monnier
2015-11-20 15:59   ` John Wiegley
     [not found]   ` <mailman.342.1448035187.31583.help-gnu-emacs@gnu.org>
2015-11-21  5:52     ` cinsk [this message]
2015-11-21 15:04       ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2929ffa3-d339-43c3-84e8-2211dcc53695@googlegroups.com \
    --to=cinsky@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.