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.