Quoting Martin Renold (2020-03-14 11:36:08)
> I'd also like PCRE2 to be enabled. Stumbled over it because emacs/ivy's code 
> search used the "--pcre2" switch without checking whether it was available.
> 
> Upstream provides .deb packages that have it enabled, statically linked it 
> seems:
> https://github.com/BurntSushi/ripgrep/blob/master/ci/build_deb.sh#L41-L43
> 
> When building manually I had to use 'cargo build --features pcre2 --release'
> 
> Quote README:
> * ripgrep has optional support for switching its regex engine to use PCRE2.
>   Among other things, this makes it possible to use look-around and
>   backreferences in your patterns, which are not supported in ripgrep's 
> default
>   regex engine. PCRE2 support can be enabled with `-P/--pcre2` (use PCRE2
>   always) or `--auto-hybrid-regex` (use PCRE2 only if needed).

I don't know ripgrep specifically, but from my work on licensecheck it 
is my experience that RE2 engine is quite powerful compared to PCRE2, so 
reading above I recommend to try "--auto-hybrid-regex" before "--pcre2" 
(and report as a bug if "--auto-hybrid-regex" fails.

If those options are runtime options both available when ripgrep is 
built with pcre2 support, then I sugges to encourage reverse 
dependencies that hardcode "--pcre2" to try patch the code to instead 
use "--auto-hybrid-regex".

 - Jonas

-- 
 * Jonas Smedegaard - idealist & Internet-arkitekt
 * Tlf.: +45 40843136  Website: http://dr.jones.dk/

 [x] quote me freely  [ ] ask before reusing  [ ] keep private

Attachment: signature.asc
Description: signature

Reply via email to