<?php
header("Content-Type:text/html;charset=utf-8");
$str = '開開開開開不不不起';
$reg = '/[\x{4e00}-\x{9fa5}]{5}/u';
preg_match($reg,$str,$match);
$str = '開不開開開開開不不不起';
$reg = '/[\x{4e00}-\x{9fa5}]{5}/u'; //開不開開開
preg_match($reg,$str,$match);
var_dump($match);
die;
//需求:篩選出連續出現5次的字符 開開開開開
$str = '開不開開開開開不不不起';
$reg = '/([\x{4e00}-\x{9fa5}])\1{4}/u'; //開\1{4} ---> 開開{4}
//\1引用的是第一個小組的內容
//\2引用的是第二個小組的內容
//..
preg_match_all($reg,$str,$match);
var_dump($match);