From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Andreas Schwab Newsgroups: gmane.emacs.devel Subject: Re: regexp case sensitivity bug Date: Tue, 10 Dec 2002 11:52:12 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <3DF3B4D0.D4628D27@cs.unc.edu> <3DF518E2.6FDE0A01@cs.unc.edu> <5xptsad7mq.fsf@kfs2.cua.dk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1039519081 22029 80.91.224.249 (10 Dec 2002 11:18:01 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Tue, 10 Dec 2002 11:18:01 +0000 (UTC) Cc: 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 18LiOm-0005j4-00 for ; Tue, 10 Dec 2002 12:18:00 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.12 #1 (Debian)) id 18LiZJ-0007Ve-00 for ; Tue, 10 Dec 2002 12:28:53 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Li0E-0000IS-0B for emacs-devel@quimby.gnus.org; Tue, 10 Dec 2002 05:52:38 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18Lhzu-0000I9-00 for emacs-devel@gnu.org; Tue, 10 Dec 2002 05:52:18 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18Lhzr-0000Hg-00 for emacs-devel@gnu.org; Tue, 10 Dec 2002 05:52:17 -0500 Original-Received: from ns.suse.de ([213.95.15.193] helo=Cantor.suse.de) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18Lhzr-0000HY-00 for emacs-devel@gnu.org; Tue, 10 Dec 2002 05:52:15 -0500 Original-Received: from Hermes.suse.de (Charybdis.suse.de [213.95.15.201]) by Cantor.suse.de (Postfix) with ESMTP id 8AF4514B59; Tue, 10 Dec 2002 11:52:14 +0100 (MET) X-Authentication-Warning: sykes.suse.de: schwab set sender to schwab@suse.de using -f Original-To: storm@cua.dk (Kim F. Storm) X-Yow: Is this TERMINAL fun? In-Reply-To: <5xptsad7mq.fsf@kfs2.cua.dk> (storm@cua.dk's message of "10 Dec 2002 01:45:17 +0100") Original-Lines: 23 User-Agent: Gnus/5.090007 (Oort Gnus v0.07) Emacs/21.3.50 (ia64-suse-linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Emacs development discussions. List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:10031 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:10031 storm@cua.dk (Kim F. Storm) writes: |> Or we can use a completely different approach: |> |> (defun isearch-no-upper-case-p (string regexp-flag) |> "..." |> (let ((case-fold-search nil)) |> (save-match-data |> (null (string-match |> (if regexp-flag "\\(^\\|[^\\]\\)[[:upper:]]" "[[:upper:]]") |> string))))) That needs to check whether there is an even number of \ before the letter, because only then the letter is not part of a special regex matcher. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."