Skip to content

Instantly share code, notes, and snippets.

@zhanglun
Created September 4, 2015 13:23
Show Gist options
  • Select an option

  • Save zhanglun/9fdaa76c89e8e8e718f4 to your computer and use it in GitHub Desktop.

Select an option

Save zhanglun/9fdaa76c89e8e8e718f4 to your computer and use it in GitHub Desktop.

Revisions

  1. zhanglun created this gist Sep 4, 2015.
    9 changes: 9 additions & 0 deletions UUID.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    UUID(版本4)的形式为:
    ```
    xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
    ```
    其中,x 是任意十六进制字符,y 是 8,9,a,b,A,B 其中之一。它的正则表 达式可以写作:

    ```js
    /[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/
    ```