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" wrote: > Artur Malabarba 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 >