3 ms·
Does . match one bytes or one characters?
by paulddraper 2y ago
Does . match one bytes or one characters?
- burntsushi 2y ago`.`, which is `(?u:.)` by default, matches the UTF-8 encoding of any Unicode scalar value except for the newline terminator. `(?-u:.)` matches any individual byte except for the newline terminator. You can't use `(?-u:.)` when searching `&str` because it could match invalid UTF-8. `Regex::new` will fail if you try. You can only use it when searching `&[u8]` via `regex::bytes::Regex`.