Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: REMATCH_PCRE with zsh built without pcre support
- X-seq: zsh-users 22653
- From: Daniel Shahaf <d.s@xxxxxxxxxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: Re: REMATCH_PCRE with zsh built without pcre support
- Date: Mon, 3 Apr 2017 11:26:11 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=NCVDKjgGAWO1zNrNFxnDrjNGP0ChU7AatYmFsI76Dzc=; b=lmAPUQlB oLGqQg1aMRKZe7FTdoOuCoSzUzWYU8DHR4CeYZjPgdrAb8joEcyGvCs4TsAQYTRL BL0LhUi/mFoiblJP7U/VAY6sIoL7FIuQ2SVa+JOpmiQIzY99EvstJEUk+5PNuqpN iXAODXt5H1+i3MvPjv5/Ty5yL9N386E++E0HfxKBqC6uxxhF2XRzDRqHce2j2pzn zF3Tod3C8V4VAs3dZdPCFzwmg4NVLncbk8ToZeyta+XdusZIkMF4DFFpWvC15a6U JmFd7PvT6si42m/roWKZv5MGZwcV5pEUBfNHrMvRF636D6GPVtL1+hOlxDofGfhE oHaHGNcheivhSQ==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=NCVDKjgGAWO1zNrNFxnDrjNGP0ChU7AatYmFsI76Dzc=; b=MSTKl90Q 2s2aOJIb5YPd5kE8mNdUPUoP4aEq/3JDGskY0daKBV1Bb37aIC1KPIHkWg1W4g/Z rgqVu9mW5LH4vIhxBnUIlsTd/5LRAqzJu7nbGmDKnzb89ikYgrWTbpVTdoCojhZC mAZFwxcHgOK9inUAai8tOBzTlkidmwcMidxcAVPuguMINUAmqj53vwaluRnQVVL9 8Z//FBhpbUHlU6+eD0XfG4kF//fUTu6B0+PxFNdSWxZFyZAs/bvLqVv+I/inL3fi AT7fYxEv3fkD00+Lbo8WLLT6TCbPcbvEZUxYYtO3VWm23BdEO7+rb6cbHHPfQbmC q9on+xXtOet0cQ==
- In-reply-to: <CAH+w=7YWqmJXHbAf0p2KwDxJqOXVzu7HzCugV0NjFfVYsVGMJw@mail.gmail.com>
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
- References: <27c2026c-f760-32b0-e0d5-8c6909346979@gmx.com> <170401145348.ZM30308@torch.brasslantern.com> <20170403011159.GA64116@tower.spodhuis.org> <CAH+w=7YWqmJXHbAf0p2KwDxJqOXVzu7HzCugV0NjFfVYsVGMJw@mail.gmail.com>
Bart Schaefer wrote on Mon, Apr 03, 2017 at 00:13:00 -0700:
> Phil Pennock wrote:
> > On 2017-04-01 at 14:53 -0700, Bart Schaefer wrote:
> >> I'd personally be more inclined to do away with REMATCH_PCRE and that
> >> =~ special-case entirely, and require explicit use of the -pcre-match
> >> operator (or a shorter equivalent) when you want those semantics.
> >
> > That's a shame.
>
> To clarify, I'm not advocating any such demotion of PCRE. However,
> *IF* the presence of the option when the module is not available is
> really a serious problem, then I think the right thing is to remove
> the option, rather than to expand the special case.
I agree that semantics of operators shouldn't depend on option, but I'm
concerned about an upgrade path for people who build with pcre and set
REMATCH_PCRE.
> > I'll have to hunt down that thread and see what I can do about that.
>
> It's the recent "zregexparse" thread where this came up. I'm not sure
> there is anything to be done about it; the zsh/regex module would have
> to become part of the default static build, which might have licensing
> consequences.
What would those be? zsh/regex is BSD licensed.
>
While at it, the docs of REMATCH_PCRE made me think that =~ fell back to
zsh/regex semantics if zsh/pcre were unavailable, which isn't the case
(it just fails — which is good). Hence:
diff --git a/Doc/Zsh/options.yo b/Doc/Zsh/options.yo
index 1f8d98b..cc6ae2a 100644
--- a/Doc/Zsh/options.yo
+++ b/Doc/Zsh/options.yo
@@ -725,7 +725,8 @@ cindex(regexp, PCRE)
cindex(PCRE, regexp)
item(tt(REMATCH_PCRE))(
If set, regular expression matching with the tt(=~) operator will use
-Perl-Compatible Regular Expressions from the PCRE library, if available.
+Perl-Compatible Regular Expressions from the PCRE library.
+(The tt(zsh/pcre) module must be available.)
If not set, regular expressions will use the extended regexp syntax
provided by the system libraries.
)
Messages sorted by:
Reverse Date,
Date,
Thread,
Author