Remove lines that contain non-english (Ascii) characters from a file

awk, grep, regex, sed, unix

Solution

Perl supports an `[:ascii:]` character class.

perl -nle 'print if m{^[[:ascii:]]+$}' inputfile

Problem

I have a text file with characters from different languages like (chinese, latin etc) I want to remove all lines that contain these non-English characters. I want to include all English characters (a-b), numbers (0-9) and all punctuations. How can I do it using unix tools like awk or sed.

Original source