: This article mainly introduces the php-preg-1, for PHP tutorials interested in students can refer. Q. Regular expression
Regular expressions are composed of three parts: atoms, metacharacters, and pattern correction. Atoms are common
delimitation Symbol :A variety of can, commonly used for//Atoms :The smallest matching unit (placed in the delimiter), in a regular expression, at least one atom1, print characters (A-Z a-z 0-9 [email protected]#$%^&* () _+ ... ) and nonprinting
Demo Code
Operation effect (Figure 1)
Operation effect (Figure 2)
Main Package function
Multi_process ();According to the parameters, create the number of pointers to the child process.Bright spot Function 1: The
Q. Regular Expressions
Regular expressions are made up of atoms, meta-characters, and pattern corrections in three parts. The atom is also the ordinary character.
Metacharacters
\d: Matches any decimal number [0-9]
\s: Matches any white space
Mixed preg_replace (mixed $pattern, mixed $replacement, mixed $subject [, int $limit =-1 [, int & $count]])
Returns an array if subject is an array, otherwise returns a string. If an error occurs, NULL is returned. Modifier \e is deprecated,
Note:Backslashes have special meanings in both single-quote strings and double-quote strings, so to match a backslash, the pattern must be written as "\\\\". "/\\/", first it as a string, the backslash will be escaped, then the result of escaping is/
In the use of regular expressions, I have been in the guerrilla, it is time to come up with a summary. Because of the irresistible reason of stupidity, can only choose to simply say, only write down the ASCII encoding character matching and
IP blacklist implementation method is to put the IP to be filtered in a TXT file or database, and then when we access to obtain our IP address and then to traverse the comparison can be achieved.
The school's news system requires some news to only
The school's news system requires some news only to open the campus IP browsing, so rewrite a code to implement this function, the result is, as long as the IP access allowed to be included in the Ip.txt this file, while supporting the C-class IP,
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.