MCPcopy Create free account
hub / github.com/coooodeer/parse-rust / parse

Method parse

src/parser.rs:201–204  ·  view source on GitHub ↗

Parse a string for an exact match against the format. The entire string must match the format pattern. Returns None if the string does not match. # Arguments `input` - The string to parse # Returns Some(ParseResult) on success, None if no match.

(&self, input: &str)

Source from the content-addressed store, hash-verified

199 /// # Returns
200 /// Some(ParseResult) on success, None if no match.
201 pub fn parse(&self, input: &str) -> Option<ParseResult> {
202 let captures = self.match_re.captures(input)?;
203 self.try_evaluate_captures(&captures, input, 0).ok().flatten()
204 }
205
206 pub fn parse_with_error(&self, input: &str) -> Result<Option<ParseResult>, String> {
207 let captures = match self.match_re.captures(input) {

Calls 1

try_evaluate_capturesMethod · 0.80