← All docs

preg_match()

Performs a regular expression match.

preg_match()

function preg_match(string $pattern, string $subject, array $matches = null): int|false

Performs a regular expression match.

Parameters:

  • $pattern (string)
  • $subject (string)
  • $matches (array), passed by reference, default null, optional

Returns: int|false

Availability

Compiled (AOT)Magician (eval)
AvailableAvailable

No examples yet. Check examples/ and showcases/ for usage patterns.

Internals

For how preg_match is implemented in the compiler, see the internals page.