You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
char boundary byte indexing panic when using Regex::split #417
externcrate regex;fnmain(){let a = std::str::from_utf8(b"\\B(?-u)|0").unwrap();let b = std::str::from_utf8(b"\n\xcd\x86").unwrap();let c = regex::Regex::new(a).unwrap();
c.split(b).collect::<Vec<_>>();}
thread 'main' panicked at 'byte index 2 is not a char boundary; it is inside '͆' (bytes 1..3) of `
͆`', src/libcore/str/mod.rs:2232:4
note: Run with `RUST_BACKTRACE=1` for a backtrace.
changed the title [-]char boundary byte indexing panic when using Regex::spit[/-][+]char boundary byte indexing panic when using Regex::split[/+]on Nov 24, 2017
This was fixed in regex 0.2.7. In particular, negated word boundaries can match invalid UTF-8, which the new regex-syntax crate now detects correctly. Previous it didn't.
Activity
[-]char boundary byte indexing panic when using Regex::spit[/-][+]char boundary byte indexing panic when using Regex::split[/+]BurntSushi commentedon Nov 24, 2017
frewsxcv commentedon Nov 24, 2017
@BurntSushi yep, just confirmed it happens in master too. here's a backtrace
BurntSushi commentedon Apr 28, 2018
This was fixed in
regex 0.2.7. In particular, negated word boundaries can match invalid UTF-8, which the new regex-syntax crate now detects correctly. Previous it didn't.