[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#2816: regexp-opt: does not optimize 'Abc' and 'abc'
From: |
Stefan Monnier |
Subject: |
bug#2816: regexp-opt: does not optimize 'Abc' and 'abc' |
Date: |
Sun, 29 Mar 2009 13:13:09 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux) |
> A)
> (regexp-opt
> '("Abc"
> "abc"))
> => "\\(?:[Aa]bc\\)"
> B)
> (regexp-opt
> '("Abc"
> "def"
> "abc"))
> => "\\(?:Abc\\|abc\\|def\\)"
> Shouldn't regexp-opt optimize B case as well?
The `opt' of regexp-opt should be understood in the sense of
optimization used in compilers, not in the formal mathematical sense of
"optimal". I.e. it does some effort to improve things, but without any
guarantee about what is and what isn't optimized.
So, yes, it would be good if it did do what you suggest, but it's not
a bug if it doesn't.
Stefan