What version of regex are you using?
regex == 1.12.3
regex_lite == 0.1.9
Describe the bug at a high level.
regex and regex_lite both support "flag-setters". They have the following syntax: (?flags). This looks superficially like a group but only sets a flag.
However the two tools disagree on whether this element of the syntax associates with a repetition operator.
What are the steps to reproduce the behavior?
let pattern = "a(?u)*";
let haystack = "aaa";
dbg!(regex_lite::Regex::new(pattern).unwrap().find_iter(haystack).collect::<Vec<_>>());
dbg!(regex::Regex::new(pattern).unwrap().find_iter(haystack).collect::<Vec<_>>());
What is the actual behavior?
regex_lite does not associate the repetition operator with the flag setter (?u), so it will simply behave equivalent to a* and match the three a's.
regex does associate the repetition operator with the flag setter, and gives an error:
regex parse error:
a(?u)*
^
error: repetition operator missing expression
What is the expected behavior?
I can see something for both approaches but they should probably be equivalent.
What version of regex are you using?
regex == 1.12.3regex_lite == 0.1.9Describe the bug at a high level.
regexandregex_liteboth support "flag-setters". They have the following syntax:(?flags). This looks superficially like a group but only sets a flag.However the two tools disagree on whether this element of the syntax associates with a repetition operator.
What are the steps to reproduce the behavior?
What is the actual behavior?
regex_litedoes not associate the repetition operator with the flag setter(?u), so it will simply behave equivalent toa*and match the threea's.regexdoes associate the repetition operator with the flag setter, and gives an error:What is the expected behavior?
I can see something for both approaches but they should probably be equivalent.