Returns the capture groups corresponding to the leftmost-first match in `text`. Capture group `0` always corresponds to the entire match. If no match is found, then `None` is returned. You should only use `captures` if you need access to the location of capturing group matches. Otherwise, `find` is faster for discovering the location of the overall match. # Examples Say you have some text with
(&self, text: &'t str)
| 309 | /// The `0`th capture group is always unnamed, so it must always be |
| 310 | /// accessed with `get(0)` or `[0]`. |
| 311 | pub fn captures<'t>(&self, text: &'t str) -> Option<Captures<'t>> { |
| 312 | let mut locs = self.capture_locations(); |
| 313 | self.captures_read_at(&mut locs, text, 0).map(move |_| Captures { |
| 314 | text: text, |
| 315 | locs: locs.0, |
| 316 | named_groups: self.0.capture_name_idx().clone(), |
| 317 | }) |
| 318 | } |
| 319 | |
| 320 | /// Returns an iterator over all the non-overlapping capture groups matched |
| 321 | /// in `text`. This is operationally the same as `find_iter`, except it |
nothing calls this directly
no test coverage detected