This article mainly introduces the meaning of isU in preg_match in php. For more information, see the meaning of isU in case sensitivity, here, s still does not include line breaks, while U reverses the matching quantity so that it is not the default repetition. this is probably the way we read the article.
What does the/(. *)/isU and "isU" parameter after the regular expression mean?
This is the modifier in the regular expression.
I is used to search for uppercase and lowercase letters at the same time,
S indicates that the dot (.) matches all characters, including line breaks. if s is not set, the line breaks are not included.
U reverses the value of the matching quantity so that it is not the default repetition, but becomes behind "?" To be repeated.
Example
In the regular expression syntax compatible with preg_match, B represents the word boundary.
So: which of the following is OK ???
$ A = "test, admin, abc"; $ B = "te"; $ exist = preg_match ("/B {$ B} B/", $ ); if ($ exist) {echo "exists";} else {echo "does not exist ";}
Take a look at the relevant instructions
The code is as follows:
Int preg_match (string pattern, string subject [, array matches [, int flags]);
Preg_match () returns the number of times pattern matches. Either 0 (no match) or 1 time, because preg_match () will stop searching after the first match. Preg_match_all () indicates that, on the contrary, the end of the subject is always searched. If an error occurs in preg_match (), false is returned.
Example:
<?php$a = "abcdefgabcdefaaag";preg_match('|abc([a-z]+)g|isu',$a,$out1);preg_match_all('|abc([s]+)g|isu',$a,$out2);echo "";print_r($out1);print_r($out2);echo "
";?>
Statement:
When double quotation marks are used, they are different from single quotation marks.
<?phppreg_match_all("/href="(.*)"/isu",$contents,$out);preg_match_all('|href="(.*)"|isu',$contents,$out);?>
The above content is the meaning of preg_match isU in php, which I hope everyone will like.