emacs-devel
[Top][All Lists]
Advanced

[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: 26 Aug 2002 00:21:43 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Kenichi Handa <address@hidden> writes:

> In article <address@hidden>, "Eli Zaretskii" <address@hidden> writes:
> >>  (let ((case-fold-search nil))
> >>    (string-match "[A-_]" "A")) => 0
> >>  (let ((case-fold-search t))
> >>    (string-match "[A-_]" "A")) => nil
> >>  (let ((case-fold-search t))
> >>    (string-match "[A_]" "A")) => 0
> 
> > Does that happen because under case-fold-search non-nil the
> > characters on the range specification are downcased?
> 
> Yes.
> 
> >>  In my opinion, specifying ranges by chars are nonsense
> >>  because there should be no semantics in the order of
> >>  characters codes.
> 
> > Sorry, I don't understand: how would one specify a range _except_
> > with two characters and a dash between them?  What am I missing?
> 
> I mean that the concept of character range itself is not
> good.  A character code is just an identifier of a
> character.  We usually don't think about "a range of
> identifiers" (e.g. "symbols in the range between t and nil"
> is nonsense).

Which is why [[:alpha:]] [[:digit:]] etc were invented for regex's.
They are supposed to "look at the locale"...

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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