On 05/18/2011 07:44 PM, Seth David Schoen wrote:
> You are correct that these cases (unlike ranges) can be optimized.
Suppose grep had a preprocessor that converted any bracket
expression containing elements of different byte sizes, whether
[美国a] or a range not all of whose characters are a single byte,
into a parenthesized alternation like (美|国|a). Would this use
more memory, constituting a space-for-time tradeoff? If not, is
there some other reason not to do this?
There's no justification but laziness. :) We already optimized a large
amount of character ranges---basically all that can be optimizaed except
this one.
Paolo