This article mainly introduces relevant information about php preg_match matching examples of languages in different countries. Friends in need can refer to
php preg_match matching examples of languages in different countries
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}/",'中国') );
is not possible
You need to add a parameter u and 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') );
Thank you for reading, I hope it can help everyone, Thank you all for your support of this site!
The above is the entire content of this article, I hope it will be helpful to everyone's study.
Related recommendations:
php uses the preg_match() function to implement the method of verifying the ip address
php preg_matchMatch string length case analysis
PHP preg_match Detailed explanation of the steps for matching string length
#
The above is the detailed content of Detailed explanation of php preg_match matching examples of languages in different countries. For more information, please follow other related articles on the PHP Chinese website!