I have a text file and I want to use Unix commands (I don't care which) to print lines that contain a Chinese character OR contain the string ###.
This answer has a grep command which prints out the lines containing Chinese characters
grep -P '[\p{Han}]' filename.txt
which I understand is a Perl regular expression. And this prints out the lines containing ###:
grep '###' filename.txt
But I can't figure out how to combine (OR) them. If I do grep -e '###' -P '[\p{Han}]'
as I might expect this answer would generalize, it doesn't print out the lines containing Chinese characters.
Question: How do I use Unix commands to print lines that contain Chinese characters OR lines that contain ###?
Oh, in case it helps, if the file contains
中文 keep this line
### keep this line
don't keep this line
it should output
中文 keep this line
### keep this line