From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: Zsh Users <zsh-users@zsh.org>
Subject: Re: REMATCH_PCRE with zsh built without pcre support
Date: Mon, 3 Apr 2017 11:26:11 +0000 [thread overview]
Message-ID: <20170403112611.GA4333@fujitsu.shahaf.local2> (raw)
In-Reply-To: <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.
)
next prev parent reply other threads:[~2017-04-03 11:31 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-01 19:09 Eric Cook
2017-04-01 21:53 ` Bart Schaefer
2017-04-03 1:12 ` Phil Pennock
2017-04-03 7:13 ` Bart Schaefer
2017-04-03 11:26 ` Daniel Shahaf [this message]
2017-04-03 18:00 ` Bart Schaefer
2017-04-04 0:36 ` Daniel Shahaf
2017-04-04 2:43 ` Bart Schaefer
2017-04-04 12:27 ` Eric Cook
2017-04-05 13:08 ` Daniel Shahaf
2017-04-04 15:22 ` Ray Andrews
2017-04-04 23:00 ` Bart Schaefer
2017-04-05 13:42 ` Peter Stephenson
2017-04-05 22:28 ` Bart Schaefer
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=20170403112611.GA4333@fujitsu.shahaf.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-users@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).