OS: Archlinux grep version: 2.27-1 Bug description: grep behaves weirdly when searching hex values. How to reproduce: $ printf '\x53\xef' | grep -aoP '\x53\xef' (no output, returns 1) $ printf '\x53\xc3\xaf' | grep -aoP '\x53\xef' Sï $ printf '\x53\xc3\xef' | grep -aoP '\x53\xef' (no output, returns 1) grep (version 2.12-2) provided by Debian works just fine.