分享一个实用的技巧,在项目中快速找到所有的中文字符

也不仅仅Emacs有用吧,所有的编辑器都适用的。

快速在一个项目内找到所有的中文字符(或者日文等其它字符)

1. helm-do-ag 
2. 选择 dir
3. 输入[^\x00-\xff] (双字节)  

来自 eclipse中搜索替换所有中文字符_「已注销」的博客-CSDN博客

顺便,有没有人能把上面的3个步骤包装成一个函数啊,手动输入[^\x00-\xff] 挺累的。

1 个赞

或者用 Emacs 正则表达式 \ccC-M-s \cc,第二个 c 表示中文字符。

3 个赞

为什么 \cc 可以代表中文呢?

Elisp info 手册中有说明

\cc
matches any character that belongs to the category c. 
For example, ‘\cc’ matches Chinese characters, ‘\cg’ matches Greek characters, etc. For the description of the known categories, type M-x describe-categories RET.
1 个赞