On FreeBSD 12.3-RELEASE, zsh-5.8; when I type "setopt rematchpcre" I get the message: failed to load module `zsh/pcre': Cannot open "/usr/local/lib/zsh/5.8/zsh/pcre.so" -pcre-match not available for regex When I run "man zshmodules", though, the "zsh/pcre" module is mentioned. This seems to be a regression.
this is not a regression, the pcre option is off by default since its introduction in 2007. am I missing something?
The "pcre" option is indeed turned off by default in the shell, hence my attempt to enable it through "setopt rematchpcre". IIRC, in either FreeBSD 11 or 10, this worked correctly, i.e. the shell option was turned off by default, but the pcre.so extension was installed and available by giving the "setopt rematchpcre" command. It looks as if the zsh was previously configured/compiled with "--enable-pcre", but this configuration flag was left off for the 12.3 build. Hence, not only is the pcre module not turned on by default (which is not a problem), it is now *impossible* to turn it on explicitly (which *is* a problem). Hope this clarifies the issue.
It is not built by default aka not available at all in the default package one has to rebuild with the PCRE option set on at build time. If if rebuild with PCRE on zmodload zsh/pcre setopt rematchpcre works as expected. I have looked at the history and I never activated at all the build of the pcre support for the last 10 years, so I am suprised it somehow worked for you in earlier version of FreeBSD