From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: storm@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.devel Subject: Re: regex and case-fold-search problem Date: 26 Aug 2002 00:21:43 +0200 Sender: emacs-devel-admin@gnu.org Message-ID: <5x7kiey3yg.fsf@kfs2.cua.dk> References: <200208230625.PAA23426@etlken.m17n.org> <9003-Fri23Aug2002185625+0300-eliz@is.elta.co.il> <200208240051.JAA24648@etlken.m17n.org> NNTP-Posting-Host: localhost.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1030310566 6257 127.0.0.1 (25 Aug 2002 21:22:46 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 25 Aug 2002 21:22:46 +0000 (UTC) Cc: eliz@is.elta.co.il, emacs-devel@gnu.org Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 17j4qL-0001co-00 for ; Sun, 25 Aug 2002 23:22:45 +0200 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 17j5Kq-0006d1-00 for ; Sun, 25 Aug 2002 23:54:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j4rZ-0006Mv-00; Sun, 25 Aug 2002 17:24:01 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10) id 17j4p6-0006Io-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 17:21:28 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10) id 17j4p3-0006IR-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 17:21:27 -0400 Original-Received: from mail.filanet.dk ([195.215.206.179]) by monty-python.gnu.org with esmtp (Exim 4.10) id 17j4p3-0006HW-00 for emacs-devel@gnu.org; Sun, 25 Aug 2002 17:21:25 -0400 Original-Received: from kfs2.cua.dk.cua.dk (unknown [10.1.82.3]) by mail.filanet.dk (Postfix) with SMTP id 345837C017; Sun, 25 Aug 2002 21:21:18 +0000 (GMT) Original-To: Kenichi Handa In-Reply-To: <200208240051.JAA24648@etlken.m17n.org> Original-Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50 Errors-To: emacs-devel-admin@gnu.org X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.devel:6875 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:6875 Kenichi Handa writes: > In article <9003-Fri23Aug2002185625+0300-eliz@is.elta.co.il>, "Eli Zaretskii" 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 http://www.cua.dk