regex_automata::util::syntax

Function parse

source
pub fn parse(pattern: &str) -> Result<Hir, Error>
Expand description

A convenience routine for parsing a pattern into an HIR value with the default configuration.

ยงExample

This shows how to parse a pattern into an HIR value:

use regex_automata::util::syntax;

let hir = syntax::parse(r"([a-z]+)|([0-9]+)")?;
assert_eq!(Some(1), hir.properties().static_explicit_captures_len());