Home >Backend Development >PHP Tutorial >About PHP regular matching Chinese
Recommendation: "PHP Video Tutorial"
PHP regular matching Chinese
@author: CooperZhang
Regular matching character set [{4e00}-\x{9fa5}]
Note:
/^...$/u
1. The match contains all Chinese
/^[{4e00}-\x{9fa5}]+$/u
2. The match contains Chinese
/[{4e00}-\x{9fa5}]+/u
3. Match Chinese and English (including symbols _
)
/[\w{4e00}-\x{9fa5}]+/u
The above is the detailed content of About PHP regular matching Chinese. For more information, please follow other related articles on the PHP Chinese website!