Regular: [\S]{2,32}
Filtering works
In PHP:
<?php var_dump( preg_match("/[\S\b]{2,32}/",'ج') ); echo '<hr />'; var_dump( preg_match("/[\S\b]{2,32}/",'中国') );
doesn’t work
You need to add a parameter u, read the code according to uniode
<?php var_dump( preg_match("/[\S\b]{2,32}/u",'ج') ); echo '<hr />'; var_dump( preg_match("/[\S\b]{2,32}/u",'中国') ); echo '<hr />'; var_dump( preg_match("/[\S\b]{2,32}/u",'Дракон') ); echo '<hr />'; var_dump( preg_match("/[\S\b]{2,32}/u",'cc') );
For more PHP preg_match matching skills in multiple languages, please pay attention to the PHP Chinese website!