mb_ereg_search_regs()
mb_ereg_search_regs() — Returns the matched part of a multibyte regular expression.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.2.0, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
Signature
mb_ereg_search_regs(?string $pattern = null, ?string $options = null): array|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $pattern | ?string | The search pattern. |
| $options | ?string | The search option. See mb_regex_set_options() for explanation. |
Return value
mb_ereg_search_regs() executes the multibyte regular expression match, and if there are some matched part, it returns an array including substring of matched part as first element, the first grouped part with brackets as second element, the second grouped part as third element, and so on. It returns false on error.
Example
The PHP manual ships no example for mb_ereg_search_regs(); the signature and the parameter table above are the contract.
Changelog
| Version | Change |
|---|---|
| 8.0.0 | pattern and options are nullable now. |
See also
mb_regex_encoding(), mb_ereg_search_init()
All PHP 8.5 built-in functions
Reference card built from the PHP manual page mb_ereg_search_regs() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.