Function name: mb_ereg_search_regs()
Applicable version: PHP 4 >= 4.2.0, PHP 5, PHP 7
Usage: The mb_ereg_search_regs() function is used to return the result of the last multibyte regular expression match.
Syntax: mb_ereg_search_regs( [ string $pattern [, string $options = "msr" ]] ) : array|false
parameter:
Return value:
Example:
$str = "Hello, 你好,世界!"; mb_ereg_search_init($str, '[\x{4e00}-\x{9fa5}]'); mb_ereg_search(); $regs = mb_ereg_search_regs(); print_r($regs);
Output:
Array ( [0] => 你)
In the above example, we first use the mb_ereg_search_init() function to initialize a multibyte regular expression search and specify the range of Chinese characters to match. Then use the mb_ereg_search() function to perform the search. Finally, by calling the mb_ereg_search_regs() function, we obtain the array of subgroup match results of the matching results, where the first element is the complete match result.