I\'m using the fancy-regex crate since I need lookaheads in my Regex but it seems like it\'s not getting all of the matches in a string like I can with the regex crate which fan
Note that your fancy_regex
code looks for two captures in a single match, which is doomed to fail since your expression only contains one capture group. What you want (and what you're doing with regex
) is a way to iterate through the matches, but it looks like fancy_regex
does not have an easy way to do it. So you will need to do it manually:
let mut start = 0;
while let Some (m) = re.captures_from_pos (values, start).unwrap() {
println!("{:?}", m.get (1).unwrap());
start = m.get (0).unwrap().start() + 1; // Or you can use `end` to avoid overlapping matches
}