unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Artur Malabarba <bruce.connor.am@gmail.com>
To: David Kastrup <dak@gnu.org>
Cc: 20307@debbugs.gnu.org
Subject: bug#20307: 25.0.50; (regexp-opt nil ...) returns ""
Date: Mon, 13 Apr 2015 16:59:36 +0100	[thread overview]
Message-ID: <CAAdUY-Lx0uoaoA8kWaaq-MQmy6A4h17_eh8=hikvMyZD5qmknQ@mail.gmail.com> (raw)
In-Reply-To: <87iod0xcs5.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 1362 bytes --]

I believe you. Please ignore this babbling baboon.
That's what I get for typing on the bus.
On Apr 13, 2015 4:34 PM, "David Kastrup" <dak@gnu.org> wrote:

> Artur Malabarba <bruce.connor.am@gmail.com> writes:
>
> > 2015-04-12 10:50 GMT+01:00 David Kastrup
> >> Both
> >>
> >> M-: (regexp-opt nil) RET
> >>
> >> and
> >>
> >> M-: (regexp-opt nil t) RET
> >>
> >> return "".  However, they should return a regexp matching nothing
> >> rather than everything, and the second invocation should also count as
> >> one () pairing.
> >
> > I agree there should be () on the second one, but I strongly disagree
> > they should match nothing.
> >
> > regexp-opt is NOT meant to match only the given strings. It is meant
> > to match anything containing the given strings.
>
> Well, and no string to match has been given.  This is not
> (regexp-opt '(""))
> but rather
> (regexp-opt '())
>
> > There is a very fundamental difference in that. The less strings you
> > pass to regexp-opt, the MORE things the regexp will match.
>
> Come again?
>
> > Why would we suddently flip that on its head when going from 1 to 0
> > strings?
>
> (regexp-opt '("a" "b" "c")) -> "[abc]"
> (regexp-opt '("a" "b")) -> "[ab]"
>
> Quite literally (execute C-x C-e after the expressions above if you
> don't believe me).  So how does "[ab]" match more than "[abc]" ?
>
> --
> David Kastrup
>

[-- Attachment #2: Type: text/html, Size: 2030 bytes --]

  reply	other threads:[~2015-04-13 15:59 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-12  9:50 bug#20307: 25.0.50; (regexp-opt nil ...) returns "" David Kastrup
2015-04-12 12:09 ` Stefan Monnier
2015-04-13 14:08 ` Artur Malabarba
2015-04-13 15:19   ` Stefan Monnier
2015-04-13 15:34   ` David Kastrup
2015-04-13 15:59     ` Artur Malabarba [this message]
2019-02-25 14:57 ` bug#20307: [PATCH] make regexp-opt return a no-match return value with empty input Mattias Engdegård
2019-03-02 12:37   ` Eli Zaretskii
2019-03-02 14:21     ` Mattias Engdegård
2019-03-02 14:41       ` Eli Zaretskii
2019-03-02 14:49         ` Mattias Engdegård
2019-03-02 14:57           ` Eli Zaretskii
2019-03-02 15:24             ` Mattias Engdegård

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to='CAAdUY-Lx0uoaoA8kWaaq-MQmy6A4h17_eh8=hikvMyZD5qmknQ@mail.gmail.com' \
    --to=bruce.connor.am@gmail.com \
    --cc=20307@debbugs.gnu.org \
    --cc=dak@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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).