Checks if a UUID is valid.

@param  string $uuid The UUID to validate
@return bool
432556
public static function validate(string $uuid): bool
	{
		$uuid = str_replace(['urn:uuid:', '{', '}'], '', $uuid);

		return (bool) preg_match('/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/i', $uuid);
	}
19577
public function getItem($uuid)
    {
        $found = null;
        foreach ($this->items as $item) {
            if ($item->getUuid() === $uuid) {
                $found = $item;
                break;
            }
        }

        return $found;
    }
30830
def _is_uuid(uuid):
    '''
    
    '''
    if uuid and list((len(x) for x in uuid.split('-'))) == [8, 4, 4, 4, 12]:
        return True
    return False
1048235
public static function parse(string $uuid): Uuid
    {
        $clean = strtolower(str_replace(['urn:', 'uuid:', '{', '}'], '', $uuid));

        if (!preg_match(static::UUID, $clean, $matches)) {
            $message = sprintf('Invalid UUID string: %s', $uuid);
            throw new DomainException($message);
        }

        $timeLow = $matches[1];
        $timeMid = $matches[2];
        $timeHiAndVersion = $matches[3];
        $clockSeqHiAndReserved = $matches[4];
        $clockSeqLow = $matches[5];
        $node = $matches[6];

        return new static($timeLow, $timeMid, $timeHiAndVersion, $clockSeqHiAndReserved, $clockSeqLow, $node);
    }
1335086
public static boolean isValidUUID(String uuid) {
        return !StringUtils.isEmpty(uuid) && UUID_PATTERN.matcher(uuid).matches();
    }
881768
public function convertToCompliantUuid($uuid=false){
        $id = ($uuid?$uuid:$this->uuid);
        $arr = [8, 13, 18, 23];
        foreach ($arr as $part){
            $id = substr_replace($id, '-', $part, 0);
        }
        return $id;
    }
185021
private function resolvePathByUuid($uuid)
    {
        $queryBuilder = new QueryBuilder($this->qomFactory);

        $queryBuilder
            ->select('node', 'jcr:uuid', 'uuid')
            ->from($this->qomFactory->selector('node', 'nt:unstructured'))
            ->where(
                $this->qomFactory->comparison(
                    $this->qomFactory->propertyValue('node', 'jcr:uuid'),
                    '=',
                    $this->qomFactory->literal($uuid)
                )
            );

        $rows = $queryBuilder->execute();

        if (1 !== count(iterator_to_array($rows->getRows()))) {
            throw new ItemNotFoundException();
        }

        return $rows->getRows()->current()->getPath();
    }
777455
public static function isValid($uuid)
    {
        $uuid = str_replace(array('urn:', 'uuid:', '{', '}'), '', $uuid);

        if ($uuid == self::NIL) {
            return true;
        }

        if (!preg_match('/^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/', $uuid)) {
            return false;
        }
        return true;
    }
1088421
protected function isValid($value)
    {
        if (!is_string($value) || !preg_match(self::PATTERN_MATCH_UUID, $value)) {
            $this->addError('The given subject was not a valid UUID.', 1221565853);
        }
    }
1310168
private function check(string $uuid): void
    {
        $uuid32 = \str_replace('-', '', $uuid);

        if (\preg_match('/^[0-9a-f]{8}[0-9a-f]{4}[4][0-9a-f]{3}[89ab][0-9a-f]{3}[0-9a-f]{12}$/i', $uuid32) !== 1) {
            throw new InvalidArgumentException('Invalid UUID version 4 provided.');
        }

        $this->hexUUID = $uuid;
    }
870880
public static void validateUUID(String uuid, String uuidValueOf) throws RuntimeException {
        if (!WSManUtils.isUUID(uuid)) {
            throw new RuntimeException("The returned " + uuidValueOf + " is not a valid UUID value! " + uuidValueOf + ": " + uuid);
        }
    }
1088814
public function getSelection($uuid)
    {
        foreach ($this->selections as $selection) {
            if ($selection->getUuid() === $uuid) {
                return $selection;
            }
        }
    }
1236774
public function isValid($id)
    {
        $ttl = $this->hasOption(self::OPTION_TTL) ? $this->getOption(self::OPTION_TTL) : self::DEFAULT_TTL;
        if ($this->getPersistence()->supportsFeature(\common_persistence_KeyValuePersistence::FEATURE_NX)) {
            return $this->getPersistence()->set(self::PREFIX.$id, 't', $ttl, true);
        } else {
            if ($this->getPersistence()->exists(self::PREFIX.$id)) {
                return false;
            }
            return $this->getPersistence()->set(self::PREFIX.$id, 't', $ttl);
        }
    }
415993
public static function isValid($ip)
    {
        $valid = self::isValidv4($ip);
        if ($valid) {
            self::$ip = $ip;
            self::$isv6 = false;
            return true;
        }

        $valid = self::isValidv6($ip);
        if ($valid) {
            self::$ip = $ip;
            self::$isv6 = true;
            return true;
        }
        return false;
    }
996504
public static boolean isUuid(final String uuid) {
        return uuid != null && (uuid.length() == 36 || uuid.length() == 32)
                && UUID_PATTERN.matcher(uuid).matches();
    }
922902
public static function is_valid( $guids = [] ) {
		$instance = self::get_instance();
		foreach ( $guids as $guid ) {
			if ( isset( $instance->plugins[ $guid ] ) && $instance->plugins[ $guid ]->valid ) {
				return true;
			}
		}

		return false;
	}
1178872
protected function findModelByUUID($uuid)
    {
        if (($model = Article::findOne(['uuid' => $uuid])) != null) {
            return $model;
        }
        throw new NotFoundHttpException(Yii::t('yii', 'The requested page does not exist'));
    }