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

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

Re: match-end doesn't work!


From: Kenichi Handa
Subject: Re: match-end doesn't work!
Date: Mon, 13 Mar 2006 10:43:57 +0900
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

In article <19675039.1142172869209.JavaMail.root@ps18>, "stfn.sbtn@tiscali.it" 
<stfn.sbtn@tiscali.it> writes:

> Actions that triggered the bug:

> (string-match "quick" "The quick brown fox jumps on the brown lazy 
> dog") ==>4 
> (match-string 0 "The quick brown fox jumps on the brown lazy dog") ==> 
> "T"
> (match-beginning 0) ==> 4
> (match-end 0) ==> 1

Perhaps, you evaluated them one by one, which runs another
regexp matching code, thus changes match-data.  Try this
instead:

(let ((str "The quick brown fox jumps on the brown lazy dog"))
  (string-match "quick" str)
  (list (match-string 0 str)
        (match-beginning 0)
        (match-end 0)))

I got this:
("quick" 4 9)

---
Kenichi Handa
handa@m17n.org




reply via email to

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