Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

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

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

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

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report