Closed
Description
There is is_match
that checks if there is a match for the given string, there is shortest_match
that checks if there is a match and returns the length of the shortest match, but no method that checks if there is a match and returns the length of the longest match.
Re-using the shortest_match
example, we would have:
let text = "aaaaa";
let pos = Regex::new(r"a+").unwrap().longest_match(text);
assert_eq!(pos, Some(5));
Metadata
Metadata
Assignees
Labels
No labels