以下功能主要是用于中英文拆分
示例
php通过正则拆分中英文
$str = 'whether…or 是…还是…,不管…还是';
preg_match_all('/([A-Za-z\s…?’]+)([\x{4e00}-\x{9fa5}();;,…。、?]*)/u',$str,$string);
print_r($string);
输出
Array (
[0] => Array ( [0] => whether…or 是…还是…,不管…还是 )
[1] => Array ( [0] => whether…or )
[2] => Array ( [0] => 是…还是…,不管…还是 )
)
上面暂时只使用于左边是英文,右边是中文的情况
未经允许不得转载:任鹏个人博客 » php通过正则拆分中英文
最新评论
Forex wiki. https://lt.forex-stock-bitcoin-brokers.com
Magnificent items from you, man. I have take note your stuff
Following on from the 3rd March Meetings held by economic de
It is remarkable, rather valuable message dfgdlfg2131.32
一般都会有一个沙盒期的,过了沙盒期就会慢慢放出来
百度不收录是应为是新站的原因吗?
The spike in consumer prices that left inflation at a four-d