zsh-workers
 help / color / mirror / code / Atom feed
From: Oliver Kiddle <opk@zsh.org>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH?] Re: [BUG] `$match` is haunting my regex’s trailing, optional, capture
Date: Thu, 25 Jan 2024 23:14:34 +0100	[thread overview]
Message-ID: <76604-1706220874.334202@5f0E.FnU8.oa7O> (raw)
In-Reply-To: <CAH+w=7a3fdXQP+2StR23W=7jCJJ02tC4QjnRi-Tq2=xXOMY84g@mail.gmail.com>

On 11 Dec, Bart Schaefer wrote:
> On Mon, Dec 11, 2023 at 3:49 PM Oliver Kiddle <opk@zsh.org> wrote:
> >
> > diff --git a/Src/Modules/pcre.c b/Src/Modules/pcre.c
>
> So is this instead of my patch or as well?

Instead. Sorry for not getting back sooner. I had forgotten this. The
following adds a test case.

Oliver

diff --git a/Test/V07pcre.ztst b/Test/V07pcre.ztst
index 585698d05..b8cd31c96 100644
--- a/Test/V07pcre.ztst
+++ b/Test/V07pcre.ztst
@@ -108,6 +108,11 @@
 >0 xo→t →t
 >0 Xo→t →t
 
+  [[ foo =~ (pre)?f(o*)(opt(i)onal)?(y)* ]]
+  typeset -p match
+0:Empty string for optional captures that don't match
+>typeset -g -a match=( '' oo '' '' '' )
+
   string="The following zip codes: 78884 90210 99513"
   pcre_compile -m "\d{5}"
   pcre_match -b -- $string && print "$MATCH; ZPCRE_OP: $ZPCRE_OP"


      reply	other threads:[~2024-01-25 22:14 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-09  5:14 chris0e3
2023-12-09  6:23 ` Bart Schaefer
2023-12-09 20:54   ` [PATCH?] " Bart Schaefer
2023-12-11 23:49     ` Oliver Kiddle
2023-12-12  1:38       ` Bart Schaefer
2024-01-25 22:14         ` Oliver Kiddle [this message]

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

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

  git send-email \
    --in-reply-to=76604-1706220874.334202@5f0E.FnU8.oa7O \
    --to=opk@zsh.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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 NNTP newsgroup(s).