What does the Preg_match isu in PHP mean _php instance

Source: Internet
Author: User
Tags repetition
ISU is the meaning of the case, and here S also does not include the newline character and U is reversing the value of the match number so that it is not the default repetition, presumably this is the individual we look at the article.

What does the "IsU" parameter mean after the/(. *)/isu of the regular?

This is the modifier in the regular.

I am also looking for uppercase and lowercase letters,

S is a dot (.) Matches all characters, including line breaks. If S is not set, the line break is not included.

You are reversing the value of the matched quantity so that it is not the default repetition, and it becomes followed by "?". It just gets repetitive.

Cases

Preg_match compatible Regular expression syntax B stands for Word boundaries

So: The following should be possible???

$a = "TEST,ADMIN,ABC"; $b = "TE"; $exist =preg_match ("/b{$b}b/", $a); if ($exist) {echo "exists";} Else{echo "does not exist";}

Take a look at the relevant instructions

Copy the Code code as follows:
int Preg_match (string pattern, string subject [, array matches [, int flags]]);

Preg_match () returns the number of times that pattern matches. Either 0 times (no match) or 1 times, because Preg_match () stops searching after the first match. Preg_match_all () Instead, it searches until the end of subject. If error Preg_match () returns false.

Example:

<?php$a = "Abcdefgabcdefaaag";p reg_match (' |abc ([a-z]+) G|isu ', $a, $out 1);p Reg_match_all (' |abc ([s]+) G|isu ', $a, $ OUT2); echo "
";p Rint_r ($out 1);p Rint_r ($out 2); echo"
";? >

Writing:

Use double quotation marks when different from single quotation marks

<?phppreg_match_all ("/href=" (. *) "/isu", $contents, $out);p reg_match_all (' |href= ' (. *) "|isu ', $contents, $out);? >

The above is a small part of the PHP to explain the meaning of Preg_match isu, I hope you like.

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.