I have some text like this:
This is some text Z书. This is Zsome more text Z计算机.
This is yet some more Z电脑 text Z.
I need to delete all cases matching the pattern Z+(CJK), where (CJK) is any number of continuous CJK characters. The file above would become:
This is some text . This is Zsome more text .
This is yet some more text Z.
How can I delete all CJK text matching this pattern?
You can using
GNU sedto check the codes of non-ASCII characters:Results:
Then you can use
GNU sedto do the replacement you desire. In my testing I had to set my locale to POSIX:Results: