regexExtract

Given an expression with capture groups, this will return those captures.

Description

array regexExtract(string $pattern, string $options)

Basically this is the same as regexMatch() but returns the array of matches from preg_match() where as regexMatch() just returns a boolean result.

Parameters

  • string $pattern
    Regex pattern to match against.

  • string $options
    Matching conditions to be used.

Return Value

array
The matches discovered by preg_match().