[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: regex and case-fold-search problem

From: Kim F. Storm
Subject: Re: regex and case-fold-search problem
Date: 29 Aug 2002 17:00:16 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, address@hidden (Kim F. Storm) writes:
> > IMO, it is wrong to handle case-fold-search for regexp ranges by
> > trying to modify the interpretation of the regex range.
> > Instead, the regex matcher should try to upcase and lowercase each
> > character in the string and see if either of these caracters are
> > within the given range.
> I also reached to that idea.  It makes regexp compiling
> simpler and faster but makes regexp matching a little bit
> slower.  I don't know if that slowerness is tolerable or
> not, but it's worth trying.

Maybe it can be semi-optimized for a char C as follows:

 MATCH = (C in range) ||
          (UC = uppercase(C)) != C ? (UC in range) : (lowercase(C) in range))
Kim F. Storm <address@hidden> http://www.cua.dk

reply via email to

[Prev in Thread] Current Thread [Next in Thread]