MCPcopy Create free account
hub / github.com/davidblewett/rure-python / shortest_match

Method shortest_match

regex/src/re_unicode.rs:617–619  ·  view source on GitHub ↗

Returns the end location of a match in the text given. This method may have the same performance characteristics as `is_match`, except it provides an end location for a match. In particular, the location returned *may be shorter* than the proper end of the leftmost-first match. # Example Typically, `a+` would match the entire first sequence of `a` in some text, but `shortest_match` can give up

(&self, text: &str)

Source from the content-addressed store, hash-verified

615 /// # }
616 /// ```
617 pub fn shortest_match(&self, text: &str) -> Option<usize> {
618 self.shortest_match_at(text, 0)
619 }
620
621 /// Returns the same as shortest_match, but starts the search at the given
622 /// offset.

Callers

nothing calls this directly

Calls 1

shortest_match_atMethod · 0.45

Tested by

no test coverage detected