Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: PATCH: migrate pcre module to pcre2



On 2023-05-06 at 01:35 +0200, Oliver Kiddle wrote:
> The old PCRE library that zsh uses is considered "end of life, and is no
> longer being actively maintained". The newer PCRE2 has a slighty
> different interface. It has been around since 2015 so this is not new.
> Actual version numbers are 8.x and 10.x rather than 1 and 2. Migrating
> seems to be the sensible way forward rather than, for example, adding a
> separate zsh/pcre2 module. That way, zsh users don't need to be
> concerned with the change.

Before anything else, this is great to see, thank you.

> Would it perhaps be useful to add support for PCRE2's alternative DFA
> algorithm? This might meet the needs Phil was considering with the re2
> based module he once posted but never committed. What form might that
> take?

I handed in my commit bit a while back because I used it so rarely and
it felt better for commit to be only the people more actively involved.
Shells and their provenance matter.  So I can't commit.

My main motivation with RE2 was to get to something which all vendors
will actually include when distributing.  The reason can't be licensing,
since the PCRE lib is BSD licensed.

I'd seen RE2 pick up quite a bit of steam and wanted to explore to see
how feasible it was.

Ideally, we'd have a contact within Apple who can tell us what they
might or might not consider, so that we can have working regexps with
semantics younger than POSIX.2 (1992) and some more actual utility.  I'm
tired of dealing with regexps being so sub-par 30 years later.  Trying
to write tools which work both for people using macOS and people using
Linux today pretty much means "write a client in Go".  Which is fine,
but sometimes a scripted solution is desirable.

I wrote the zsh/regex module because folks felt that we needed to match
Bash's semantics and use ERE by default when I added the  =~  syntactic
sugar.  I still see the benefit of that, but wonder if not doing so
would have led to a better net outcome, as distributors would have had
to enable a modern RE engine to get =~ working ... or would it have just
left =~ not working on random platforms.

-Phil




Messages sorted by: Reverse Date, Date, Thread, Author