Regular Expressions (Regular expression, abbreviated as Regexp,regex or REGXP), also known as regular expressions, regular expressions, or regular or normalized representations or formal representations, refer to a A single string that describes or matches a series of strings that conform to a certain syntactic rule. In many text editors or other tools, regular expressions are often used to retrieve and/or replace text content that conforms to a pattern. Many programming languages support the use of regular expressions for string manipulation. For example, in Perl, a powerful in-regular expression engine is built in. The concept of regular expressions was initially popularized by tools software (such as SED and grep) in Unix. (Excerpt from Wikipedia)
PHP uses two regular expression rules at the same time, one set is the POSIX Extended 1003.2 compliant regular by the Institute of Electrical and Electronics Engineers (IEEE) (In fact PHP is not perfect for this standard), and the other set comes from Pcre (Perl Compatible Regular Expression) Library provides Perl-compatible regular, an open-source software, the author of Philip Hazel.
It is recommended to use the Pcre (Perl Compatible Regular Expression) library to provide Perl-compliant regularization, which is more efficient than POSIX.
Fast learning: A quick way to learn PHP regular expressions POSIX-style and compatible Perl-style regular expression of the two main functions of the Regex fast-track table
The functions that use POSIX compliant rules are:
Ereg_replace ()
Ereg ()
Eregi ()
Eregi_replace ()
Split ()
Spliti ()
Sql_regcase ()
Mb_ereg_match ()
Mb_ereg_replace ()
Mb_ereg_search_getpos ()
Mb_ereg_search_getregs ()
Mb_ereg_search_init ()
Mb_ereg_search_pos ()
Mb_ereg_search_regs ()
Mb_ereg_search_setpos ()
Mb_ereg_search ()
Mb_ereg ()
Mb_eregi_replace ()
Mb_eregi ()
Mb_regex_encoding ()
Mb_regex_set_options ()
Mb_split ()
The functions that use Perl compatibility rules are:
Preg_grep ()
Preg_replace_callback ()
Preg_match_all ()
Preg_match ()
Preg_quote ()
Preg_split ()
Preg_replace ()
< reference: http://php.net/manual/zh/intro.pcre.php & http://www.jb51.net/article/38630.htm &/http Www.css119.com/book/regexp/>
Parsing POSIX vs. Perl standard Regular expression differences---PHP