banner
yono

yono

哈喽~欢迎光临
follow
github

Add fixed spaces between Chinese and English using regular expressions

Documents should comply with standards as much as possible.

sparanoid/chinese-copywriting-guidelines: Chinese copywriting guidelines for better written communication/中文文案排版指北

One very important point is

"Research shows that people who do not like to add spaces between Chinese and English while typing have a hard time in love. Seventy percent of them will marry someone they do not love by the age of 34, while the remaining thirty percent can only leave their inheritance to their cats. After all, both love and writing require appropriate pauses.

Let's encourage each other." — vinta/paranoid-auto-spacing

Manually checking spaces between Chinese and English is time-consuming and labor-intensive. There is a regular expression like this:

Find:

([\u4e00-\u9fa5]+)([A-Za-z])

Replace with:

$1 $2

To add spaces between Chinese and English.

Find:

([A-Za-z])([\u4e00-\u9fa5]+)

Replace with:

$1 $2

To add spaces between English and Chinese.

This article was synchronized and updated to xLog by Mix Space. The original link is https://www.yono233.cn/notes/27

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.