(pattern: &str)
| 36 | |
| 37 | impl 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 | } |
no test coverage detected