BurntSushi/ripgrep · error
regex could not be compiled with either the default regex en
Error message
regex could not be compiled with either the default regex engine or with PCRE2.
default regex engine error:
{divider}
{rust_err}
{divider}
PCRE2 regex engine error:
{pcre_err} What it means
Error "regex could not be compiled with either the default regex engine or with PCRE2. default regex engine error: {divider} {rust_err} {divider} PCRE2 regex engine error: {pcre_err}" thrown in BurntSushi/ripgrep.
Source
Thrown at crates/core/flags/hiargs.rs:402
anyhow::bail!(suggest_other_engine(err.to_string()));
}
},
EngineChoice::PCRE2 => Ok(self.matcher_pcre2()?),
EngineChoice::Auto => {
let rust_err = match self.matcher_rust() {
Ok(m) => return Ok(m),
Err(err) => err,
};
log::debug!(
"error building Rust regex in hybrid mode:\n{rust_err}",
);
let pcre_err = match self.matcher_pcre2() {
Ok(m) => return Ok(m),
Err(err) => err,
};
let divider = "~".repeat(79);
anyhow::bail!(
"regex could not be compiled with either the default \
regex engine or with PCRE2.\n\n\
default regex engine error:\n\
{divider}\n\
{rust_err}\n\
{divider}\n\n\
PCRE2 regex engine error:\n{pcre_err}",
);
}
}
}
/// Build a matcher using PCRE2.
///
/// If there was a problem building the matcher (such as a regex syntax
/// error), then an error is returned.
///
/// If the `pcre2` feature is not enabled then this always returns anView on GitHub (pinned to 3fce3b5bb0)
Solutions
- Fix the regex syntax errors reported by both engines in the message
- Test the pattern with a simpler subset to isolate the invalid construct
When it happens
Trigger: Thrown at crates/core/flags/hiargs.rs:402 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/e94831bd48b65103.json.
Report an issue: GitHub.