The following code should pass both strings along, but passes none: printf 'xxx\nyyy\n' | bsdgrep '\(xxx\|yyy\)'
Alternations ("|") are ERE feature (see 9.4.7 in http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html), so you need to run it as: $ printf "xxx\nyyy\n" | bsdgrep -E 'xxx|yyy' xxx yyy
Thanks for clarification, was under impression that it should be working as it works on GNU grep. Sorry.