rust-pcre icon indicating copy to clipboard operation
rust-pcre copied to clipboard

why "\xd0" does not match?

Open h4cnull opened this issue 2 years ago • 1 comments

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());

h4cnull avatar Aug 10 '22 12:08 h4cnull

in pcre_compile function, the option | PCRE_UTF8 | PCRE_NO_UTF8_CHECK , "PCRE_UTF8" should be remove.

h4cnull avatar Aug 16 '22 09:08 h4cnull