Closed as not planned
Description
I have a project with a bunch of integration tests which make a requests to a HTTP server we're writing, and then assert that the response matches a regex.
In case of a match, the test continues. In case of a mismatch, the test fails with an error message. The error messages print the regex and then the text, and it's often quite hard to figure out where in the text the regex wasn't able to match.
If we could get the index of the first non-maching character, or the index of the last matching character, then we could point out that position in the response body, which would improve our error messages a great deal.
Would it be possible to provide something like this?
impl Regex {
fn first_mismatch_position(&self, str: &str) -> Option<usize> {
todo!()
}
}