GNU bug report logs - #33175
26.1; match-string

Previous Next

Package: emacs;

Reported by: 濱田和明 <hmd24kaz <at> gmail.com>

Date: Sat, 27 Oct 2018 11:00:01 UTC

Severity: normal

Tags: notabug

Found in version 26.1

Done: Noam Postavsky <npostavs <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 33175 in the body.
You can then email your comments to 33175 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#33175; Package emacs. (Sat, 27 Oct 2018 11:00:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to 濱田和明 <hmd24kaz <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 27 Oct 2018 11:00:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: 濱田和明 <hmd24kaz <at> gmail.com>
To: "bug-gnu-emacs <at> gnu.org" <bug-gnu-emacs <at> gnu.org>
Subject: 26.1; match-string
Date: Sat, 27 Oct 2018 19:59:16 +0900
[Message part 1 (text/plain, inline)]
(progn
   (string-match "\\(key[ \t]*\\)= \\(.*\\)" (buffer-string))
   (match-string 0))

Key = 100
->#("
Key = 10" 0 1 (fontified t) 1 9 (fontified t))

Is not “key = 100”?

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#33175; Package emacs. (Sat, 27 Oct 2018 11:11:02 GMT) Full text and rfc822 format available.

Message #8 received at 33175 <at> debbugs.gnu.org (full text, mbox):

From: Noam Postavsky <npostavs <at> gmail.com>
To: 濱田和明 <hmd24kaz <at> gmail.com>
Cc: 33175 <at> debbugs.gnu.org
Subject: Re: bug#33175: 26.1; match-string
Date: Sat, 27 Oct 2018 07:10:16 -0400
tags 33175 notabug
close 33175
quit

濱田和明 <hmd24kaz <at> gmail.com> writes:

> (progn
>    (string-match "\\(key[ \t]*\\)= \\(.*\\)" (buffer-string))
>    (match-string 0))
>
> Key = 100
> ->#("
> Key = 10" 0 1 (fontified t) 1 9 (fontified t))
>
> Is not “key = 100”?

    (match-string NUM &optional STRING)

    [...]
    STRING should be given if the last search was by ‘string-match’ on STRING.

Try this instead:

    (let ((str (buffer-string)))
       (string-match "\\(key[ \t]*\\)= \\(.*\\)" str)
       (match-string 0 str))





Added tag(s) notabug. Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 11:11:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 33175 <at> debbugs.gnu.org and 濱田和明 <hmd24kaz <at> gmail.com> Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 27 Oct 2018 11:11:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 24 Nov 2018 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 6 years and 268 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.