public static function getValidKey($pattern, $arr) {
        $keys = array();
        foreach($arr as $key => $value) {
            if (preg_match($pattern, $key)){
                $keys[] = $key;
            }
        }

        return $keys;
    }