BurntSushi/ripgrep · error

unrecognized regex engine '{string}'

Error message

unrecognized regex engine '{string}'

What it means

Error "unrecognized regex engine '{string}'" thrown in BurntSushi/ripgrep.

Source

Thrown at crates/core/flags/defs.rs:1819

wasn't included in your build of ripgrep, then using this flag will result in
ripgrep printing an error message and exiting.
.sp
This overrides previous uses of the \flag{pcre2} and \flag{auto-hybrid-regex}
flags.
"
    }
    fn doc_choices(&self) -> &'static [&'static str] {
        &["default", "pcre2", "auto"]
    }

    fn update(&self, v: FlagValue, args: &mut LowArgs) -> anyhow::Result<()> {
        let v = v.unwrap_value();
        let string = convert::str(&v)?;
        args.engine = match string {
            "default" => EngineChoice::Default,
            "pcre2" => EngineChoice::PCRE2,
            "auto" => EngineChoice::Auto,
            _ => anyhow::bail!("unrecognized regex engine '{string}'"),
        };
        Ok(())
    }
}

#[cfg(test)]
#[test]
fn test_engine() {
    let args = parse_low_raw(None::<&str>).unwrap();
    assert_eq!(EngineChoice::Default, args.engine);

    let args = parse_low_raw(["--engine", "pcre2"]).unwrap();
    assert_eq!(EngineChoice::PCRE2, args.engine);

    let args = parse_low_raw(["--engine=pcre2"]).unwrap();
    assert_eq!(EngineChoice::PCRE2, args.engine);

    let args =

View on GitHub (pinned to 3fce3b5bb0)

Solutions

  1. Use a supported regex engine: 'default', 'pcre2', or 'auto'
  2. Rebuild ripgrep with PCRE2 support if you need the pcre2 engine

When it happens

Trigger: Thrown at crates/core/flags/defs.rs:1819 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/46d83abcee3af2ff.json. Report an issue: GitHub.