← All docs

preg_match()

Performs a regular expression match.

preg_match()

function preg_match(string $pattern, string $subject, array $matches = []): int

Performs a regular expression match.

Parameters:

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

Returns: int

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

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