From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Joe Corneli Newsgroups: gmane.emacs.help Subject: multiple alternatives regexp question Date: Tue, 06 Jan 2004 19:19:55 -0600 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1073438761 2529 80.91.224.253 (7 Jan 2004 01:26:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2004 01:26:01 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 02:25:58 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Ae2SM-0004hM-00 for ; Wed, 07 Jan 2004 02:25:58 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ae3Nt-00055z-4D for geh-help-gnu-emacs@m.gmane.org; Tue, 06 Jan 2004 21:25:25 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1Ae3Kc-0002BI-1W for help-gnu-emacs@gnu.org; Tue, 06 Jan 2004 21:22:02 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Ae3K2-0001lc-D1 for help-gnu-emacs@gnu.org; Tue, 06 Jan 2004 21:21:57 -0500 Original-Received: from [146.6.139.124] (helo=dell3.ma.utexas.edu) by monty-python.gnu.org with esmtp (Exim 4.24) id 1Ae3K2-0001lD-0v for help-gnu-emacs@gnu.org; Tue, 06 Jan 2004 21:21:26 -0500 Original-Received: from lab45.ma.utexas.edu (mail@lab45.ma.utexas.edu [128.83.133.159]) by dell3.ma.utexas.edu (8.11.0.Beta3/8.10.2) with ESMTP id i071JtB22703; Tue, 6 Jan 2004 19:19:55 -0600 Original-Received: from jcorneli by lab45.ma.utexas.edu with local (Exim 3.36 #1 (Debian)) id 1Ae2MV-0007nZ-00; Tue, 06 Jan 2004 19:19:55 -0600 Original-To: help-gnu-emacs@gnu.org In-reply-to: (help-gnu-emacs-request@gnu.org) X-all-your-base-are-belong-to-us: You are on the way to destruction. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:15751 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15751 I am interested in a regexp that I think should be written like this (for inclusion in a program): "\\([[:lower:]]\\|[[:digit:]]\\|A\\)\\([A-Z]\\)" In other words, a lower case letter, or a digit, or an `A', followed by a capital letter. Unfortunately, when I search and replace like so: (let ((case-fold-search nil)) (while (re-search-forward "\\([[:lower:]]\\|[[:digit:]]\\|A\\)\\([A-Z]\\)" nil t) (replace-match (concat (match-string 1) " " (match-string 2))))) on something like ProofOfPropertiesOfTraceOfAMatrix I get back Proof Of Properties Of Trace Of AMatrix ^ (Note that if you run the above code on the output string, it will make a space in the appropriate place!) Why is the `A' not being treated the way I want the first time around?