-
Notifications
You must be signed in to change notification settings - Fork 450
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Erroneous failure to match in simple regex #289
Comments
|
The minimal test case I've found for this bug is: assert!(Regex::new("(ABC|CDA|BC)X").unwrap().is_match("CDAX")); |
Gah. Probably a bug in the literal optimizations (again). |
The problem here is that the literals returned by
... because |
Specifically, given the strings ABCX, CDAX and BCX, it was reporting the unambiguous set as A, BCX and CDAX, which is wrong since A is a substring of CDAX. unambiguous_prefixes is now quite a bit of a mess, but so is the rest of the literal extraction code. The only thing it has going for it is a massive test suite. Fixes rust-lang#289
OK, |
No problem! :) Thanks for the quick fix! |
I'm new to this so maybe I made a mistake, but this seems to still not be working in the original |
@ConnorGray Wow. Serves me right for trusting the minimal example. Dammit. Your original example does indeed fail. sigh Working on it... |
@ConnorGray Derp. The minimal example was good. I just messed up the release. |
@ConnorGray All right, |
@BurntSushi Looks good :) |
Phew. Thanks for your patience! |
Haha no problem, I was surprised it got fixed this quickly! |
The simple regexes
((IMG|MVI|MGG)|DS)X
and(((IMG|MVI)|MG)|DS)X
both ought to match the string"MVIX
, but only the second one does.The text was updated successfully, but these errors were encountered: