Skip to main content

translate_pcre_to_rust

Function translate_pcre_to_rust 

Source
fn translate_pcre_to_rust(pattern: &str) -> String
Expand description

Build a compiled regex from a pattern string, respecting fixed and ignore.case options. Returns Err(RError) if the pattern is invalid regex. Translate R/PCRE regex patterns to Rust regex syntax.

Handles known incompatibilities:

  • \] inside character classes → ] (PCRE allows escaping ], Rust doesn’t)