<?PHP//the regular provided by the Preg_ library Preg_match();//make regular expression matches /*The Preg_match (pattern, subject, matches) parameter describes the pattern regular expression subject You need to match the retrieved object matches optional, storing an array of matching results *************************************** * hint * preg_ma TCH () The match is stopped after the first match succeeds, and if you want to match all results, that is, search to the end of subject, you need to use the Preg_match_all () function. */ Preg_match_all();//make a global regular expression match Preg_replace();//perform search and replace of regular expressions /*The preg_replace (pattern, replacement, Subject,limit,count) parameter describes the pattern regular expression (a string or String array) Replacement the string or array of strings used to replace the string or array subject to be searched and replaced. Limit is optional. The maximum number of times each pattern is replaced on each subject. The default is-1 (infinity). cout is optional. Number of replacements completed*/ Preg_split();//Execute Regular expression split string/*preg_split (pattern,subject,limit,flags) parameter describes the pattern regular expression subject The string to be split The limit is limited to the number of substrings to be divided at most only the limit of flags Preg_split_no_empty if the token is set, Preg_split () will return to the non-empty part after the separation. Preg_split_delim_capture If this tag is set, the parentheses expression in the pattern used for the separation will be captured and returned. Preg_split_offset_capture If this tag is set, a string offset will be appended to each occurrence of the match returned. Note: This will change each element in the returned array so that each element becomes a delimited substring of the No. 0 element, and the 1th element is an array of the offset of the substring in subject. */ Preg_grep();//returns the array cell that matches the pattern /*Preg_grep (pattern, input, $flags) parameter describes the pattern string, regular expression/td> input to match array Flag is optional. If set to Preg_grep_invert, this function returns an array of elements in the input array that do not match the given pattern pattern. */ Preg_replace_callback();//perform search and replace of regular expressions with callback functions /*Preg_replace_callback (pattern, Callback,subject,limit,count) parameter describes the pattern regular expression CA The Llback callback function is called every time a replacement is required, and the arguments to the function are the result of matching from subject. Subject the target string or array of strings to search for replacements. Limit maximum number of replaceable times. The default is-1 (No limit). Count replaces the number of executions*/
PHP preg_ Ku Zheng matches