rust-pcre
rust-pcre copied to clipboard
why "\xd0" does not match?
let mstr = r"^\x03\0\0\x13\x0e\xd0";
let rdpb = b"\x03\0\0\x13\x0e\xd0";
println!("rdp buf {:?}",rdpb);
let no_options: EnumSet<CompileOption> = EnumSet::new();
let re = Pcre::compile_with_options(mstr, &no_options).unwrap();
let s = unsafe { std::str::from_utf8_unchecked(rdpb.as_slice()) };
let m = re.exec(s);
println!("{:?}",m.is_some());
in pcre_compile function, the option | PCRE_UTF8 | PCRE_NO_UTF8_CHECK , "PCRE_UTF8" should be remove.