Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
Python

r"
(?<=[\u4e00-\u9fa5]), *(?=[\u4e00-\u9fa5])
"
gm

Description

利用Look_behind 【字串】look_ahead 修改中文標點 【, ] 【,\s] ➔ 空白0次或多次 【,\s?] ➔ 空白0次或1次 【,\s+] ➔ 空白1次或多次

Submitted by anonymous - 6 years ago