/** * Returns array entries that match the pattern. * @param array * @param string * @param int * @return array */ public static function grep(array $arr, $pattern, $flags = 0) { NDebugger::tryError(); $res = preg_grep($pattern, $arr, $flags); NStrings::catchPregError($pattern); return $res; }