[Top][All Lists]

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

Re: Possible bug in `match-string` in

From: Stefan Monnier
Subject: Re: Possible bug in `match-string` in
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.


reply via email to

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