isU means case split. Here, s does not include newlines and U reverses the number of matches. The value makes it not a default duplication, which is probably the case when we read the article.
/(.*)/isU after the regular expression, what does the "isU" parameter mean?
This is the modifier in regular expressions.
i searches for uppercase and lowercase letters simultaneously,
s is a dot (.) matching all characters, including newlines. If s is not set, newlines are not included.
U reverses the value of the number of matches so that it is not repeated by default, but becomes repeated when followed by "?"
Example
In preg_match compatible regular expression syntax, b represents word boundary
So: The following should be OK? ? ?
$a="test,admin,abc"; $b="te"; $exist=preg_match("/b{$b}b/",$a); if($exist) { echo "存在"; }else { echo "不存在"; }
Look at the relevant instructions
Copy code The code is as follows:
int preg_match ( string pattern, string subject [, array matches [, int flags]] );
preg_match() returns the number of times pattern is matched. Either 0 times (no match) or 1 time, since preg_match() will stop searching after the first match. preg_match_all(), on the contrary, will search until the end of subject. preg_match() returns false on error.
Example:
<?php $a = "abcdefgabcdefaaag"; preg_match('|abc([a-z]+)g|isu',$a,$out1); preg_match_all('|abc([s]+)g|isu',$a,$out2); echo "<pre class="brush:php;toolbar:false">"; print_r($out1); print_r($out2); echo ""; ?>
Writing:
The difference between using double quotes and single quotes
<?php preg_match_all("/href="(.*)"/isu",$contents,$out); preg_match_all('|href="(.*)"|isu',$contents,$out); ?>
The above content is what the editor explains to you about the meaning of isU of preg_match in php. I hope you like it.