banner
yono

yono

哈喽~欢迎光临
follow
github

Add fixed spaces between Chinese and English using regular expressions

Documents should conform to 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 dislike adding spaces between Chinese and English while typing have a tough time in love. Seventy percent of them end up marrying someone they don't 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, so there is such a regular expression

Find

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

Replace

$1 $2

Add space between Chinese and English

Find

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

Replace

$1 $2

Add space between English and Chinese

This article is 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.