emacs-devel
[Top][All Lists]
Advanced

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

Re: Possible bug in `match-string` in 24.4.50.18?


From: Stefan Monnier
Subject: Re: Possible bug in `match-string` in 24.4.50.18?
Date: Sun, 25 May 2014 16:02:26 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux)

> Take the following code:

>     (setq address "mailto:address@hidden";)
>     (setq re "mailto")
>     (string-match re address)
>     (match-string 0 address)

These are 4 separate expressions.  How do you run them?
My crystal ball says that the problem is the code you unknowingly run
between each one of those expressions.  If you run them as a single
expression such as

    (let ((address "mailto:address@hidden";)
          (re "mailto"))
      (if (string-match re address)
          (match-string 0 address)))

I'm pretty sure you'll get what you want.


        Stefan



reply via email to

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