From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ken Newsgroups: gmane.emacs.help Subject: Re: bug in elisp... or in elisper??? Date: Wed, 23 Mar 2011 11:21:43 -0400 Message-ID: <4D8A1007.5070606@mousecar.com> References: <8739mek95g.fsf@fencepost.gnu.org> Reply-To: gebser@mousecar.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1300893777 6042 80.91.229.12 (23 Mar 2011 15:22:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 23 Mar 2011 15:22:57 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: David Kastrup Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Mar 23 16:22:53 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Q2Ptc-00063v-J4 for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Mar 2011 16:22:52 +0100 Original-Received: from localhost ([127.0.0.1]:43203 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2Ptb-0007NU-QA for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Mar 2011 11:22:51 -0400 Original-Received: from [140.186.70.92] (port=51077 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q2Pst-0007KI-D8 for help-gnu-emacs@gnu.org; Wed, 23 Mar 2011 11:22:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q2Psr-0003G8-Vp for help-gnu-emacs@gnu.org; Wed, 23 Mar 2011 11:22:07 -0400 Original-Received: from mout.perfora.net ([74.208.4.195]:56837) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q2Psq-0003Fp-2G; Wed, 23 Mar 2011 11:22:04 -0400 Original-Received: from dellap.mousecar.net (dsl093-011-016.cle1.dsl.speakeasy.net [66.93.11.16]) by mrelay.perfora.net (node=mrus0) with ESMTP (Nemesis) id 0Lvlo4-1Px9bv2Rhs-017kXN; Wed, 23 Mar 2011 11:22:02 -0400 User-Agent: Thunderbird 2.0.0.24 (X11/20101213) In-Reply-To: <8739mek95g.fsf@fencepost.gnu.org> X-Enigmail-Version: 0.96.0 OpenPGP: id=5AD091E7 X-Provags-ID: V02:K0:mnnyfehCWarq6wHV8tw1HslDJbpHRY/gaFdH1I2ujFW fcfASIxeJ3nv+r9PbTkFpxNWR47YdUoVFZKo6WhlsPMSfTSjVY U3JQN9O69+MQI7MGD2XmMfh8MYD8lVaPfYc0+pzV1WjyxYmKQz qu4DmKSN9C2FpGWi3TDjLHSWMraVGXCuvhStrzT/Ts3p45Jihh AVJjpszGZdab54M5bjNDR01Ab59IpbW2IXLPmBrjWk= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 74.208.4.195 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:80338 Archived-At: On 03/22/2011 07:50 PM David Kastrup wrote: > ken writes: > >> Fellow elispers, >> >> Something seems to be amiss in the search syntax here: >> >> (setq aname-re-str >> "\\(\\(.\\|\n\\)*?\\)> \\|\t\\|\n\\)*?\\)>" ) >> >> .... > > Uh what? > > \\(.\\|\n\\)*? > > Matches _any_ character. Yes. Why not? Users' texts can and do contain any sort of character, multiple instances of them in fact... and, moreover, in any languages' character sets they might want. They're allowed to do this. Perhaps you're perplexed because you're not noting the RE immediately following: " >> But it consistently contains the last character of of the 4th >> match-string. > > That is because it _is_ the last matched character of the 4th > match-string. > >> And these two matches are separated by the literal >> character string, " > Your ability to count \\( strings? They are assigned match numbers from > left to right, regardless of whether they are nested or not. An inability to count would be the most derogatory interpretation. But the function I wrote (here elided) actually did the counting for me, so that would not be a cogent interpretation. A mere mortal, I wasn't born knowing that REs could be nested (documentation I read in fact stated they couldn't), of course then also not that in such cases both inner and outer REs are counted separately by match-string. So once again, the more charitable interpretation is the more perspicacious... and vice versa. -- One is not superior merely because one sees the world as odious. -- Chateaubriand (1768-1848)