all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#33175: 26.1; match-string
@ 2018-10-27 10:59 濱田和明
  2018-10-27 11:10 ` Noam Postavsky
  0 siblings, 1 reply; 2+ messages in thread
From: 濱田和明 @ 2018-10-27 10:59 UTC (permalink / raw)
  To: 33175

[-- Attachment #1: Type: text/plain, Size: 190 bytes --]

(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”?


[-- Attachment #2: Type: text/html, Size: 1800 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#33175: 26.1; match-string
  2018-10-27 10:59 bug#33175: 26.1; match-string 濱田和明
@ 2018-10-27 11:10 ` Noam Postavsky
  0 siblings, 0 replies; 2+ messages in thread
From: Noam Postavsky @ 2018-10-27 11:10 UTC (permalink / raw)
  To: 濱田和明; +Cc: 33175

tags 33175 notabug
close 33175
quit

濱田和明 <hmd24kaz@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))






^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-10-27 11:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-27 10:59 bug#33175: 26.1; match-string 濱田和明
2018-10-27 11:10 ` Noam Postavsky

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.