Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

mb_ereg_search_getregs

Description

The mb_ereg_search_getregs of Multibyte String for PHP retrieve the result from the last multibyte regular expression match.

Syntax

mb_ereg_search_getregs(): array|false

Return

An array including the sub-string of matched part by last mb_ereg_search(), mb_ereg_search_pos(), mb_ereg_search_regs(). If there are some matches, the first element will have the matched sub-string, the second element will have the first part grouped with brackets, the third element will have the second part grouped with brackets, and so on. It returns false on error.

Examples

1 · void

<?

$string = '🐘string';
$pattern = '🐘(st(r(i)ng))';

mb_ereg_search_init($string, $pattern);
mb_ereg_search();

$return = mb_ereg_search_getregs();

var_export($return);

?>
array (
  0 => '🐘string',
  1 => 'string',
  2 => 'ring',
  3 => 'i',
)
HomeMenu