unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: Michael Gerdau <mgd@qata.de>
To: 20655@debbugs.gnu.org
Subject: bug#20655: According to docs non-greedy regexp should work in guile but they don't
Date: Mon, 25 May 2015 23:58:53 +0200	[thread overview]
Message-ID: <3731893.AiLGfpWM9Y@hamiller> (raw)

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

Hi list,

the guile documentation under
https://www.gnu.org/software/guile/manual/html_node/Regular-Expressions.html#index-regular-expressions
directly references Regular expressions used in Emacs which do
support non-greedy regexp.

However 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 (see below).
The thread I'm referring to is found under
https://www.mail-archive.com/guile-devel%40gnu.org/msg12022.html

Testcase:
If non-greedy regexp do work 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

For the record:
I check the same regexp in Perl where they provide the same result.


AFAICT this is either misleading if not an outright documentation bug,
or a missing feature in guile.

Kind regards,
Michael
-- 
 Michael Gerdau       email: mgd@qata.de
 GPG-keys available on request or at public keyserver

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

             reply	other threads:[~2015-05-25 21:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-25 21:58 Michael Gerdau [this message]
2016-06-23 20:41 ` bug#20655: According to docs non-greedy regexp should work in guile but they don't Andy Wingo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3731893.AiLGfpWM9Y@hamiller \
    --to=mgd@qata.de \
    --cc=20655@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).