private function matches($pattern, $subject) { if (preg_match($pattern, $subject, $matches)) { $args = array(); foreach ($matches as $key => $value) { if (!is_int($key)) { $args[$key] = $value; } } return $args; } return false; }