BurntSushi/ripgrep · error

PCRE2 is not available in this build of ripgrep

Error message

PCRE2 is not available in this build of ripgrep

What it means

Error "PCRE2 is not available in this build of ripgrep" thrown in BurntSushi/ripgrep.

Source

Thrown at crates/core/flags/hiargs.rs:462

                    // should be big enough for anything. But let's crank it to
                    // 10MB.
                    .max_jit_stack_size(Some(10 * (1 << 20)));
            }
            if !self.no_unicode {
                builder.utf(true).ucp(true);
            }
            if self.multiline {
                builder.dotall(self.multiline_dotall);
            }
            if self.crlf {
                builder.crlf(true);
            }
            let m = builder.build_many(&self.patterns.patterns)?;
            Ok(PatternMatcher::PCRE2(m))
        }
        #[cfg(not(feature = "pcre2"))]
        {
            Err(anyhow::anyhow!(
                "PCRE2 is not available in this build of ripgrep"
            ))
        }
    }

    /// Build a matcher using Rust's regex engine.
    ///
    /// If there was a problem building the matcher (such as a regex syntax
    /// error), then an error is returned.
    fn matcher_rust(&self) -> anyhow::Result<PatternMatcher> {
        let mut builder = grep::regex::RegexMatcherBuilder::new();
        builder
            .multi_line(true)
            .unicode(!self.no_unicode)
            .octal(false)
            .fixed_strings(self.fixed_strings);
        match self.case {
            CaseMode::Sensitive => builder.case_insensitive(false),

View on GitHub (pinned to 3fce3b5bb0)

Solutions

  1. Install a ripgrep build that includes the pcre2 feature
  2. Rebuild ripgrep from source with `--features pcre2`
  3. Remove the --pcre2 flag to use the default regex engine

When it happens

Trigger: Thrown at crates/core/flags/hiargs.rs:462 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BurntSushi/ripgrep@3fce3b5bb0 (2026-08-06). Data as JSON: /data/errors/1b7366ac89fbcb77.json. Report an issue: GitHub.