Skip to content

Instantly share code, notes, and snippets.

@pedro16v
Last active December 30, 2015 00:19
Show Gist options
  • Save pedro16v/7748312 to your computer and use it in GitHub Desktop.
Save pedro16v/7748312 to your computer and use it in GitHub Desktop.
PHP MBID (UUID) format validator
function ProcessMBID($string) //check if MBID {
return !empty($string) && preg_match('/^\{?[A-Za-z0-9]{8}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{4}-[A-Za-z0-9]{12}\}?$/', $string);
//^[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}$
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment