M1\Vars\Variables\VariableProvider::fetchVariableMatches PHP Method

fetchVariableMatches() private method

Fetches the variable matches in the string
private fetchVariableMatches ( string $value, string $regex ) : array
$value string The string to fetch matches for
$regex string The variable type regex
return array The matches
    private function fetchVariableMatches($value, $regex)
    {
        preg_match_all('/' . $regex . '/', $value, $matches);
        if (!is_array($matches) || !isset($matches[0]) || empty($matches[0])) {
            return false;
        }
        return $matches;
    }