0

I want to find special characters in a text file. It is known that the UTF-8 encoded file contains

Chinese characters , 
"-", 
"^A"(control-A, which is one of special characters), 
numbers, 
alphabets, and 
some other characters. <- This is what I want to find out.

I'm using Vim in Linux to find other special characters.

I used

/[^^A0-9a-zA-Z-] 

to find that, but this will also show Chinese characters. How do filter Chinese characters and show only the other special characters in the file?

1

1 Answer 1

0

The Unicode codepoint range for CJK UNIFIED IDEOGRAPHS is 0x4E00-0x9FFF; you'd have to exclude that range of characters from your [...] collection (probably using the \%uNNNN regular expression atom).

Unfortunately, Vim currently cannot search for ranges larger than 256 characters, so you'd have to combine multiple collections ([...]\|[...]\|[...]\|...), or choose a different approach.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .