Closed
Description
This program does not pass all asserts:
extern crate regex;
use regex::internal::ExecBuilder;
pub const HAYSTACK_BYTES: &'static [u8] = b"\x3D\x86\x3D\x79";
fn main() {
let pattern = r"=\b";
let haystack = &HAYSTACK_BYTES;
let re0 = ExecBuilder::new(pattern).build().unwrap().into_byte_regex();
let re1 = ExecBuilder::new(pattern).nfa().build().unwrap().into_byte_regex();
assert_eq!(re0.is_match(haystack), re1.is_match(haystack));
assert_eq!(re0.find_iter(haystack).collect::<Vec<_>>(),
re1.find_iter(haystack).collect::<Vec<_>>());
}
Found by @lukaslueg in #321
Activity
BurntSushi commentedon Feb 20, 2017
Looks like this is probably a discrepancy in how word boundaries and invalid UTF-8 are handled in the matching engines. Notably, the pattern
=(?-u:\b)
also fails, but theis_match
results are inverted.SeanRBurton commentedon Dec 10, 2017
A similar example:
BurntSushi commentedon May 17, 2022
This appears to no longer be an issue. I suspect it was fixed by #561.