Preg_match (); // used for regular expression matching, and only matches preg_match_all () once; // used for regular expression matching, preg_replace () will be matched for all compliant rules; // The regular expression replacement function preg_splite (); // The regular expression division function preg_match (mode, string subject, arraymatches) here, mode is a regular rule, string subject is the string to be matched, and arraymatches is an array of matched results. Example: [php] <? Php $ mode = '/[89]/'; // match 8 or 9 $ str = "djfkdsjk10903990sjdfdk"; preg_match ($ mode, $ str, $ arr ); print_r ($ arr);?> Output: [html] Array ([0] => 9) preg_match_all (mode, string subject, arraymatches). This function is similar to the preg_match_all () function, however, this function will match all the required content and store it in a string. Example: [php] <? Php $ mode = '/[89]/'; // match 8 or 9 $ str = "dj33f44k88dsjk10903990sjdfdk"; preg_match_all ($ mode, $ str, $ arr ); print_r ($ arr);?> Output: [html] Array ([0] => Array ([0] => 8 [1] => 8 [2] => 9 [3] => 9 [4] => 9 )) preg_replace (mixed pattern, mixed replacement, mixed subject [, int limit]) replaces the relevant content using a regular expression. It is similar to the str_replace string that has been learned before, but the function is better than it. Features: 1. the content to be replaced can be a regular expression or an array regular expression. 2. The content to be replaced can be replaced by the modifier e. The purpose of the content to be replaced is to replace some complicated content, it can also be used for content conversion. Example 1 -- array regular: [php] <? Php $ mode = array ('/{title}/', '/{author}/', '/{url }/'); $ re = array ("code cloud", "qianshou", "http://codecloud.duapp.com/"); $ str = "title: {title} <br> author: {author} <br> address: {url} "; echo"