pub fn build(parser: &str) -> Result<DocumentParser, regex::Error> {
        let mut re = RegexBuilder::new(parser);
        let re = re.multi_line(true);
        let re = re.build()?;

        // Validation
        if re.captures_len() != 2 {
            // First capturing group is the entire match.
            // Second capturing group should be the slide program.
            return Err(regex::Error::Syntax(format!(
                "must have exactly one explicit capturing group for a slide program; found {}",
                re.captures_len() - 1
            )));
        }

        Ok(Self(re))
    }
/// Creates a new document parser from a multi-line regex description of what slide program
/// blocks look like in the document. If parsing the regex fails or does not meet the
/// undermentioned regex requirements, an error is returned.
///
/// The provided regex string will be parsed as a regex subject to the following constraints:
/// - Must observe PCRE regex syntax
/// - Must contain exactly one explicit capturing group to denote the contents of a slide
///   program. For example, `(.*)` and `` ```math\n((?:.|\n)*?)\n``` `` meet this requirement,
///   while `.*`, `(.*)(.*)`, and `` ```math\n((.|\n)*?)\n``` `` do not.
/// - Will be parsed as a multi-line regex; be sure to include newlines explicitly if you want
///   them to be captured by the regex. For example, `(.*)` captures all characters except line
///   feeds; to also capture line feeds, use `((?:.|\n)*)`.
Creates a new document parser from a multi-line regex description of what slide program
blocks look like in the document. If parsing the regex fails or does not meet the
undermentioned regex requirements, an error is returned.

The provided regex string will be parsed as a regex subject to the following constraints:
Must observe PCRE regex syntax
Must contain exactly one explicit capturing group to denote the contents of a slide
program.
Creates a new document parser from a multi - line regex description of what slide program blocks look like in the document . If parsing the regex fails or does not meet the undermentioned regex requirements an error is returned . The provided regex string will be parsed as a regex subject to the following constraints : Must observe PCRE regex syntax Must contain exactly one explicit capturing group to denote the contents of a slide program .
pub fn build(parser: &str) -> Result<DocumentParser, regex::Error> {
        let mut re = RegexBuilder::new(parser);
        let re = re.multi_line(true);
        let re = re.build()?;
        // Validation
        if re.captures_len() != 2 {
            // First capturing group is the entire match.
            // Second capturing group should be the slide program.
            return Err(regex::Error::Syntax(format!(
                "must have exactly one explicit capturing group for a slide program; found {}",
                re.captures_len() - 1
            )));
        }
        Ok(Self(re))
    }
pub fn build ( parser : & str ) -> Result < DocumentParser , regex :: Error > { let mut re = RegexBuilder :: new ( parser ) ; let re = re . multi_line ( true ) ; let re = re . build ( ) ? ; // Validation if re . captures_len ( ) != 2 { // First capturing group is the entire match. // Second capturing group should be the slide program. return Err ( regex :: Error :: Syntax ( format ! ( " " re captures_len ( ) 1 ) ) ) ; } Ok ( Self ( re ) ) }
Creates a new document parser from a multi-line regex description of what slide program
blocks look like in the document.
Creates a new document parser from a multi - line regex description of what slide program blocks look like in the document .
parser
&str
parser
&str