Php regular expression matches the string ending with Chinese characters. this post is edited by zhuzhaodan at 00:04:00 on.
UTF-8 format
$ Str = "289dfh first matched jdfh388 second matched jfsj83 third matched sjfsui"
1) 289dfh first match
2) jdfh388 second match
3) jfsj83 third match
Reply to discussion (solution)
This post was last edited by xuzuning at 07:05:36 on
$ Str = "289dfh first matched jdfh388 second matched jfsj83 third matched sjfsui "; preg_match_all ('/\ w + [\ x {4e00}-\ x {9fa5}]/iu', $ str, $ r); print_r ($ r [0]);Array
(
[0] => 289dfh first match
[1] => jdfh388 second match
[2] => jfsj83 third match
)
I want to use Huanshi. the left side does not start with a Chinese character and the right side ends with a Chinese character. how can I write this?
You mean this?
You can simply use the negative order ring ~~~ I want to use Huanshi. the left side does not start with a Chinese character and the right side ends with a Chinese character. how can I write this?
This is a black list. The range is too large. you should use a white list to specify what begins
You mean this?
You can simply use the negative order ring ~~~
Why is an error reported when I remove the ending/iu?
Compilation failed: character value in \ x {...} sequence is too large at offset 8 /Iu
I indicates case-insensitive
Utable utf8
/Iu
I indicates case-insensitive
Utable utf8
Remove the U and an error is displayed. why is it wrong if U is not specified?