regex_syntax

Function parse

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

A convenience routine for parsing a regex using default options.

This is equivalent to Parser::new().parse(pattern).

If you need to set non-default options, then use a ParserBuilder.

This routine returns an Hir value. Namely, it automatically parses the pattern as an Ast and then invokes the translator to convert the Ast into an Hir. If you need access to the Ast, then you should use a ast::parse::Parser.