You are here

function uuid_is_valid in Universally Unique IDentifier 6

Determines if a UUID is valid.

5 calls to uuid_is_valid()
UUIDTestHelper::assertIsUUID in ./uuid.test
Verify the argument is a valid uuid and performs validation.
uuid_comment in ./uuid.module
Implementation of hook_comment().
uuid_nodeapi in ./uuid.module
Implementation of hook_nodeapi().
uuid_taxonomy in ./uuid.module
Implementation of hook_taxonomy().
uuid_user in ./uuid.module
Implementation of hook_user().

File

./uuid.module, line 350
Main module functions for the uuid module.

Code

function uuid_is_valid($uuid) {
  return (bool) preg_match('/^[A-Fa-f0-9]{8}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{4}-[A-Fa-f0-9]{12}$/', $uuid);
}