- Notifications
You must be signed in to change notification settings - Fork 488
Closed
Labels
Description
What version of regex are you using?
1.5.5
Describe the bug at a high level.
Running the regex ab?? on the input ab returns the match ab instead of a.
What are the steps to reproduce the behavior?
fn main() { let rx = regex::Regex::new("ab??").unwrap(); let input = "ab"; let mat = rx.find(input).unwrap(); println!("match: {}", &input[mat.range()]); }What is the actual behavior?
This program returns: ab
What is the expected behavior?
I expect the output to be a, since ?? is non greedy, it should favor not matching the second letter in the input.
All other implementations i could find matches on a only.