MCPcopy Create free account
hub / github.com/dylan-sutton-chavez/edge-python / compile

Method compile

std/re/src/main/mod.rs:38–42  ·  view source on GitHub ↗
(pattern: &str)

Source from the content-addressed store, hash-verified

36
37impl Regex {
38 pub fn compile(pattern: &str) -> Result<Regex, ReError> {
39 let prog = parser::parse(pattern).map_err(|e| ReError::Syntax(format!("{} at position {}", e.msg, e.pos)))?;
40 validate(&prog.root)?;
41 Ok(Regex { prog })
42 }
43
44 pub fn group_count(&self) -> usize { self.prog.group_count }
45}

Callers 1

loadNativeModuleFunction · 0.80

Calls 2

validateFunction · 0.85
parseFunction · 0.70

Tested by

no test coverage detected