From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.help Subject: Re: error in replace-match: "args out of range" Date: Sat, 09 Apr 2011 14:57:39 +0200 Organization: Organization?!? Message-ID: <87hba7oa4c.fsf@fencepost.gnu.org> References: <4D90D85C.5060805@mousecar.com> <4D98EE5B.4080108@mousecar.com> <87vcytd5dn.fsf@puma.rapttech.com.au> <87k4f5d4p6.fsf@puma.rapttech.com.au> <4D9FE70A.8010806@mousecar.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1302356439 433 80.91.229.12 (9 Apr 2011 13:40:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 9 Apr 2011 13:40:39 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 09 15:40:36 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 1Q8YOx-0003sI-RO for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Apr 2011 15:40:36 +0200 Original-Received: from localhost ([127.0.0.1]:45299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q8YOx-0007Yj-Bz for geh-help-gnu-emacs@m.gmane.org; Sat, 09 Apr 2011 09:40:35 -0400 Original-Path: usenet.stanford.edu!news-transit.tcx.org.uk!feeder.erje.net!newsfeed.kpn.net!pfeed09.wxs.nl!npeer.de.kpn-eurorings.net!npeer-ng0.de.kpn-eurorings.net!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help X-Face: 2FEFf>]>q>2iw=B6, xrUubRI>pR&Ml9=ao@P@i)L:\urd*t9M~y1^:+Y]'C0~{mAl`oQuAl \!3KEIp?*w`|bL5qr,H)LFO6Q=qx~iH4DN; i"; /yuIsqbLLCh/!U#X[S~(5eZ41to5f%E@'ELIi$t^ Vc\LWP@J5p^rst0+('>Er0=^1{]M9!p?&:\z]|;&=NP3AhB!B_bi^]Pfkw User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:SZ/Ta+F9Eu0s6NlzI23oKgyivMw= Original-Lines: 25 Original-NNTP-Posting-Date: 09 Apr 2011 14:57:40 CEST Original-NNTP-Posting-Host: f42bb47d.newsspool3.arcor-online.net Original-X-Trace: DXC=gPXEVm0M`>6lIh70@ 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:80737 Archived-At: ken writes: > On 04/09/2011 02:44 AM PJ Weisberg wrote: >> On 4/8/11, ken wrote: >>> On 04/07/2011 07:25 PM Tim X wrote: >>>> This was my point of warning. It is quite possible to have >>>> regexps where sub expressions are not found, but the overall regexp >>>> succeeds. >>> I'm having a hard time with that concept. Is there a small bit of >>> example code you could show it with? >> >> "I am\\( not\\)? a fish." >> >> -PJ > > And on what sort of string would that RE match but the subexpression > have the value nil (as opposed to the null string "")? Huh? Isn't that rather obvious? (list (string-match "I am\\( not\\)? a fish." "I am a fish!") (match-string 1)) => (0 nil) -- David Kastrup