Get the App
SLTechnology News&Howtos  ›  Development  › 

What does the / (. *) / isU after the php regular mean?

Shulou Source: shulou.com Published: 2022-06-03 18:50:50 11月12日 Update

This article introduces the relevant knowledge of "what is the meaning of / (. *) / isU behind the php rule". In the operation of actual cases, many people will encounter such a dilemma. Next, let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

What does the parameter "isU" mean by / (. *) / isU after the regular?

This is the modifier in the rule.

I look up uppercase and lowercase letters at the same time

S is a dot (.) Matches all characters, including newline characters. If s is not set, newline characters are not included.

U reverses the value of the matching number so that it is not the default repetition, but follows "?" To become repetitive.

Example

B stands for word boundaries in preg_match-compatible regular expression syntax

So: the following should be OK?

$a = "test,admin,abc"; $b = "te"; $exist=preg_match ("/ b {$b} b /", $a); if ($exist) {echo "exist";} else {echo "does not exist";}

Take a look at the relevant instructions

The copy 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 times (no matches) or 1 time, because preg_match () stops searching after the first match. Preg_match_all (), by contrast, searches all the way to the end of subject. Preg_match () returns false if there is an error.

Example:

Written as follows:

The difference between double quotation marks and single quotation marks

Tags: Regular meaning code representative content quotation marks newline characters more knowledge search different practical successful learning next writing words parameters at the same time dilemmas dots Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple Huawei Microsoft OPPO Reno Linux