PHP Regular expression-php Regular expression tutorial

Source: Internet
Author: User

Seventh chapter (14) Application of object-oriented detailed _ polymorphism
Polymorphic applications: Object class objects are copied to a reference to the parent class, and then the method of the parent class is invoked, but the method that executes the subclass is overridden by the parent class.
Polymorphism refers to the ability of a program to handle multiple types of objects.
Eighth chapter (1) Regular expression (function introduction and Atom)
Regular expressions are a language rule that describes the pattern of characters.
The role of regular expressions: pattern segmentation, matching, lookup, and substitution of strings.
Normal character: It consists of all print and nonprinting characters that are not shown as metacharacters .< all uppercase and lowercase characters, all numbers, all punctuation marks, and other characters >
Atoms are ordinary characters.
Atomic table []: There are characters in [] that match a single character arbitrarily.
[^]: matches any character except the inside of [^].
D: Match 0-9 of the number.
D: Matches any character except the number.
W: matches any character with letters, numbers, and underscores.
W: matches any character except letters, numbers, and underscores.
S: matches a blank character.
S: matches any character except whitespace.
F: Match page breaks.
N: Matches line breaks.
R: matches the carriage return character.
T: Matches tabs.
V: Matches the vertical tab.
Metacharacters: Characters that have special functions and uses.
*: Match its former atom 0,1 or multiple times.
+: Matches its previous Atom 1 or more times.
? : Matches its former Atom 0 times or 1 times.
. : matches any character except a newline character.
| : Matches 1 or more.
^: An atom that matches the first string of strings.
$: Matches an atom at the end of a string.
B: Match the front or back bounds of the word.
B: Match non word boundaries.
Qualifier:
{m}: Indicates that its front atom appears just as M times.
{M,n}: Indicates that its front atom appears at least m times, up to N times.
{m,}: Indicates that its front atom cannot appear less than m times.
(): All That is in () is an atom.

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.