How to find special characters in Linux Vim

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?

Marcus Thornton

Posted 2014-01-22T04:15:42.620

Reputation: 211

check this question http://stackoverflow.com/questions/8447561/vim-how-to-search-replace-special-chars

– Amit Chauhan – 2014-01-22T06:10:04.043

Answers

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.

Ingo Karkat

Posted 2014-01-22T04:15:42.620

Reputation: 19 513