Check if specified collection item exists.

@param  mixed  $key      The item key.
@param  string $regex
@param  array  &$matches [optional]

@return bool
2556
public function matches($key, $regex, &$matches = [])
    {
        if (!$this->has($key, self::HAS_ISSET)) {
            return false;
        }

        return (bool) preg_match($regex, $this->get($key), $matches);
    }
1067305
public function has($key, $fallback = true)
    {


        $exist = array_has($this->items, $key);

        if (!$exist && $fallback) {
            $exist = $this->origConfig->has($key);
        }

        return $exist;
    }
196341
public function getMatch($key)
    {
        if (!$this->lastMatchResult) {
            $this->throwException(
                "Failed to get match $key: No match result found. Use match first"
            );
        }

        return isset($this->lastMatchResult[$key])
            ? $this->lastMatchResult[$key]
            : null;
    }
153582
protected function _filterAll($regex, $content, $i = 1, $key = '') {
		if (@preg_match_all($regex, $content, $matches) === false) {
			return false;
		}
		$result = isset($matches[$i]) ? $matches[$i] : $matches[0];
		if (isset($this->_callback['_all_'])) {
			foreach ($this->_callback['_all_'] as $filter) {
				$result = array_map($filter, $result);
			}
		}
		if ($key != '' && isset($this->_callback[$key])) {
			foreach ($this->_callback[$key] as $filter) {
				$result = array_map($filter, $result);
			}
		}
		return $result;
	}
993835
protected function has($key, $cfg = null) {
        if (!$cfg)
            $cfg = $this->cfg;
        return array_key_exists($key, $cfg);
    }
162179
public function has($key): bool
    {
        return isset($this->items[$key]) || array_key_exists($key, $this->items);
    }
1307481
protected function matchRequest(array $match, Request $request) : bool
    {
        if (!$request->is(trim($match['path'], '/'))) {
            return false;
        }

        $method = collect($match['method'])->filter()->map(function ($method) {
            return strtoupper($method);
        });

        return $method->isEmpty() || $method->contains($request->method());
    }
378526
protected static function _check($check, $regex)
	{
		if (is_string($regex) && preg_match($regex, $check))
		{
			return true;
		}
		return false;
	}
325257
public function matchAll($regex)
    {
        $matches = array();
        $result = preg_match_all($regex, $this->toString(), $matches, PREG_SET_ORDER);
        if($this->isValidRegex($regex) && $result!==false && $result>0)
        {
            return ArrayList::asObjectArray($matches);
        }
        return null;
    }
639074
public function hasKey($key, $collection)
    {
        if (empty($this->queriesResultCache[ 'collectionKeys' ][ $collection ])) {
            $this->getKeys($collection);
        }

        return (bool)in_array($key, $this->queriesResultCache[ 'collectionKeys' ][ $collection ]);
    }
441672
public function containsAll(array $matches = []) {
        foreach($matches as $match) {
            if(!StringUtils::contains($this->string, $match)) {
                return FALSE;
            }
        }

        return TRUE;
    }
849245
private function regex_search_array($array, $regex) {
		$return = array();
		foreach ($array as $key => $item) {
	 		if(is_array($item)) {
	 			$tmp = $this->regex_search_array($item, $regex);
	 			if($tmp)
	 				$return[$key] = $tmp;
	 		} elseif(!is_object($item)) {
	 			//if (preg_match("/^.*".$regex.".*$/", $this->stripAccents($item))) {
	 			if (preg_match("/".$regex."/i", $this->stripAccents($item))) {
	                $return[$key] = $item;
	           	}
	 		}
		}
	 	
	    return $return;
	}
1117879
public function has($keys)
    {
        $keys = (array) $keys;
        if (!$this->elements || $keys === []) {
            return false;
        }
        foreach ($keys as $key) {
            $items = $this->elements;
            if ($this->exists($items, $key)) {
                continue;
            }
            foreach (explode('.', $key) as $segment) {
                if (!is_array($items) || !$this->exists($items, $segment)) {
                    return false;
                }
                $items = $items[$segment];
            }
        }
        return true;
    }
591992
protected function match(array $regexes, $string)
    {
        $pattern = '#(?<!like )('.join('|', $regexes).')#i';

        if (preg_match($pattern, $string, $matches)) {
            return $matches;
        }

        return false;
    }
974775
private function getMatchingData(array $params, $regex)
    {
        foreach ($params as $data) {
            if (preg_match($regex, $data)) {
                return $data;
            }
        }

        return '';
    }
683116
public boolean containsKey(Object key) {
		// the key is a direct hit from our cache
		if(cache.containsKey(key))
			return true;
		// the key is a direct hit from our hashmap
		if(container.containsKey(key))
			return true;

		// check if the requested key is a matching string of a regex key from our container
		Iterator<String> regexKeys = container.keySet().iterator();
		while(regexKeys.hasNext()) {
			if(Pattern.matches(regexKeys.next(), (String) key))
				return true;
		}
		
		// if the three previous tests yield no result, the key does not exist
		return false;
	}
62287
public function has($key)
    {
        $result = $this->get($key);

        //an empty EntityCollection means no related entities
        if ($result instanceof EntityCollection && count($result) === 0) {
            return false;
        }

        return $result ? true : false;
    }