src/Formatters/Formatter.php
protected function pregMatchArray($input, $rules, $flags = 0)
    {
        if (!is_array($rules)) {
            return false;
        }

        foreach ($rules as $rule => $value) {
            if (preg_match($rule, $input, $matches, $flags)) {
                return array_merge($matches, ['value' => $value]);
            }
        }

        return false;
    }
protected function pregMatchArray($input, $rules, $flags = 0)
    {
        if (!is_array($rules)) {
            return false;
        }

        foreach ($rules as $rule => $value) {
            if (preg_match($rule, $input, $matches, $flags)) {
                return array_merge($matches, ['value' => $value]);
            }
        }

        return false;
    }
protected function pregMatchArray ( $ input , $ rules , $ flags = 0 ) { if ( ! is_array ( $ rules ) ) { return false ; } foreach ( $ rules as $ rule => $ value ) { if ( preg_match ( $ rule , $ input , $ matches , $ flags ) ) { return array_merge ( $ matches , [ 'value' => $ value ] ) ; } } return false ; }
Applies the regular expressions stored in the keys of the given array to the given input string.
Returns the first match including the matching value.

@param string $input
@param array  $rules
@param int    $flags

@return array|bool
Applies the regular expressions stored in the keys of the given array to the given input string . Returns the first match including the matching value .