Use of preg regular function in PHP
the difference between 1.preg_match and Preg_match_all
The difference between Preg_match and Preg_match_all is that preg_match matches only once. The Preg_match_all all match until the end of the string. Cases:
: 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
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
PHP preg_replace () Regular replacement, unlike JavaScript regular substitution, PHP preg_replace () is the default is to replace all symbol matching conditions of the elements need our program processing data is not always pre-designed database
: This article mainly introduces the PHP regular expression syntax summary. if you are interested in the PHP Tutorial, you can refer to it. Http://bbs.chinaunix.net/forum.php? Mod = viewthread & tid = 4101636.
Use well
Regular expressionPHP is often
Preface
PHP is widely used in the background CGI development of the web, usually after the user data data to obtain a certain result, but if the user input data is incorrect, there will be problems, such as someone's birthday is "February 30"! What
Use regular expressions compatible with Perl in PHP. Preface PHP is widely used in Web background CGI development. it usually produces some results after user data. However, if user input data is incorrect, problems may occur, such
Preface
PHP is
Preg_match ( $ pattern, $ subject,[array&match]) preg_match_all ( $ Pattern, $ subject,array&matches) Preg match matches only once and returns a value of 0 or 1; The Preg match all matches multiple times, and how many matches to the number
: This article mainly introduces the regular expression PHP match and match_all. if you are interested in the PHP Tutorial, refer to it.
Preg_match ($ pattern, $ subject, [array & match]) preg_match_all ($ pattern, $ subject, array & matches)Preg
Php enables public accounts to actively push messages to the public in php. In php, the public account actively pushes messages. in php, the public can learn and learn from the implementation methods of friends to implement active message pushing on
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.