public function get($value, $pattern, $group = 0) { $this->assertNoEval($pattern); if (!isset($value)) { return null; } if (!preg_match($pattern, $value, $matches)) { return null; } return isset($matches[$group]) ? $matches[$group] : null; }