Skip to content

Instantly share code, notes, and snippets.

@nightire
Last active August 29, 2015 14:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nightire/3468e05fc639e46df719 to your computer and use it in GitHub Desktop.
Save nightire/3468e05fc639e46df719 to your computer and use it in GitHub Desktop.
关于 UUID 的知识

UUID(版本4)的形式为:

xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx

其中,x 是任意十六进制字符,y8,9,a,b,A,B 其中之一。它的正则表 达式可以写作:

/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment