bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `match-data' set improperly


From: Kim F. Storm
Subject: Re: `match-data' set improperly
Date: 12 Feb 2003 11:53:24 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

Matthew Swift <address@hidden> writes:

> Evaluating the following `let' form gives varying results, but the results
> should be consistent.  Correct results are always returned when `s' is "The
> quick fox...", which matches the regexp `r'.  When `s' is "great grey
> green...", which does not match `r', the results in my trials have never been
> correct: either an 'args-out-of-range' error is raised, or incorrect data is
> given, which appears to be the result of applying match-data from matching a
> previous value of `s' ("The quick fox...") to the current value of `s'.  
> Sample
> results are copied below.
> 
> My *guess* is that when `string-match' fails, it either fails to set
> `match-data' or sets it incorrectly in one of two (or more) ways.

My guess is that you are not supposed to use match-data when
string-match fails, so its value is indeed undefined in that case.

What _valid_ values would you expect it to contain after the match failed?

-- 
Kim F. Storm  http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]