mb_ereg_match()

mb_ereg_match() — Regular expression match for multibyte string.

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.

What it does

A regular expression match for a multibyte string Note: pattern is only matched at the beginning of string.

Signature

mb_ereg_match(string $pattern, string $string, ?string $options = null): bool

Parameters

ParameterTypeWhat it takes
$patternstringThe regular expression pattern.
$stringstringThe string being evaluated.
$options?stringThe search option. See mb_regex_set_options() for explanation.

Return value

Returns true if string matches the regular expression pattern, false if not.

Example

The PHP manual ships no example for mb_ereg_match(); the signature and the parameter table above are the contract.

Changelog

VersionChange
8.0.0options is nullable now.

See also

mb_regex_encoding(), mb_ereg()

All PHP 8.5 built-in functions

Reference card built from the PHP manual page mb_ereg_match() (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.