lilypond-user
[Top][All Lists]
Advanced

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

Re: non-greedy regexp don't seem to work


From: Simon Albrecht
Subject: Re: non-greedy regexp don't seem to work
Date: Mon, 25 May 2015 23:39:00 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

<https://lists.gnu.org/mailman/listinfo/bug-guile>

Yours, Simon

Am 22.05.2015 um 11:42 schrieb Michael Gerdau:
In answering my own post:

Hi list,

the following two statements should provide the exakt same strings:
(match:substring (string-match "_(.*?)_" "a_ä_ö_de_fü_") 1)
(match:substring (string-match "_([^_]*)_" "a_ä_ö_de_fü_") 1)

However for me they don't. Here is a log how I tested it:
$ guile
GNU Guile 2.0.11
Copyright (C) 1995-2014 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (match:substring (string-match "_(.*?)_"
"a_ä_ö_de_fü_") 1)
$1 = "ä_ö_de_fü"
scheme@(guile-user)> (match:substring (string-match "_([^_]*)_"
"a_ä_ö_de_fü_") 1)
$2 = "ä"
scheme@(guile-user)> ,q

I checked the same regexps in Perl and there both results are the same.

Am I overlooking the obvious or is this a bug ?
In the archive of the guile-devel ML I found a thread that seems to
indicate that guile simply does not support non-greedy regexp, which
is perfectly in line with my findings of above:
https://www.mail-archive.com/guile-devel%40gnu.org/msg12022.html

Unfortunately the guile manual seems to imply that non-greedy regexp
are indeed supported. See
https://www.gnu.org/software/guile/manual/html_node/Regular-Expressions.html#index-regular-expressions
which directly references Regular expressions used in Emacs which do
support non-greedy regexp.

This is misleading if not an outright documentation bug.

Does anybody know where or how to report this ?

Best wishes,
Michael


_______________________________________________
lilypond-user mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/lilypond-user


reply via email to

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