Change this
flip 翻转[左右变成右左] fork 叉子\分岔\岔口\复刻
Convert to
flip ;翻转[左右变成右左] fork ;叉子\分岔\岔口\复刻
I use
:%s/^\([ a-zA-Z]\+\)\([\U4E00-\U9FFF ]\+.\+\)\([ a-zA-Z]\+\)\([\U4E00-\U9FFF ]\+.\+\)$/; ;/g
Now I want
flip 翻转[左右变成右左] fork 叉子\分岔\岔口\复刻
become
flip ;翻转[左右变成右左]
fork ;叉子\分岔\岔口\复刻
How to modify the vim command to complete the line break while adding the ; symbol?
曾经蜡笔没有小新2017-05-16 16:36:35
:s/^\([ a-zA-Z]\+\)\(\([\U4E00-\U9FA5]\+[^ ]*\)\+\)\([ a-zA-Z]\+\)\(\([\U4E00-\U9FA5]\+[^ ]*\)\+\)$/;\r;/g
There are two more brackets
PS: For Chinese matching, there is a method using [^ -x]1 on the Internet. The test found that it works, but I don’t know the principle.
If there are no English or spaces in the Chinese explanation, you can write it more simply
\(\([\U4E00-\U9FA5]\+[^ ]*\)\+\)
#可以修改为:
\([^ a-zA-Z]\+\)\+