Detailed explanation of php preg_match matching examples of languages ​​in different countries

墨辰丷
Release: 2023-03-28 09:50:01
Original
1563 people have browsed it

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}/",&#39;ج&#39;) );
echo &#39;<hr />&#39;;
var_dump( preg_match("/[\S\b]{2,32}/",&#39;中国&#39;) );
Copy after login

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",&#39;ج&#39;) );
echo &#39;<hr />&#39;;
var_dump( preg_match("/[\S\b]{2,32}/u",&#39;中国&#39;) );
echo &#39;<hr />&#39;;
var_dump( preg_match("/[\S\b]{2,32}/u",&#39;Дракон&#39;) );
echo &#39;<hr />&#39;;
var_dump( preg_match("/[\S\b]{2,32}/u",&#39;cc&#39;) );
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!