The difference between the Preg_mache () function and the Preg_mache_all () function:
Preg_mache () matches only the characters in the rule once, and Preg_mache_all () matches all characters that match the criteria!
Example comparison:
The difference between the Preg_replace () and the Preg_filter () of the regular expression function:
Preg_replace () retains the replaced data, and Preg_filter () retains the replacement and the data that has not been replaced . To make an analogy:
String: ABC has a b match replaced, then Preg_replace () will get "replaced data", Preg_filter () will get "a replaced data B".
Preg_grep of the regular Expression function ():
Only do match, do not replace!!!! Show only the matching data!!!
Preg_split of the regular Expression function ():
splitting a string according to a matching rule functions like the explode () function , with the following effect:
Preg_quote of the regular Expression function ():
Escapes the target. Example:
Function Summary:
PHP Regular Expression Learning notes (the difference between several common functions)