The regex for validating uuid v4 is the following :
/^[0-9A-F]{8}-[0-9A-F]{4}-[4][0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i
As you can see, the 4th group contains [89AB][0-9A-F]{3} instead of [0-9A-F]{4}
Do you know why that is ? Is there any historical reason for this choice ?
Yesterday I found out that the library that I use doesn't generate correct uuids because of the 4th group 1st character which was randomly choosen, and I wonder why there is such a restriction since this makes implementations a bit more complex.
I found out my answer on this Wikipedia article
So in the fourth block, N is the variant.
So for the following variants, you would allow following characters :
Variant 0 was used in the past and is now kind of obsolete,
Variant 1 is the most commonly used variant, since the use of [89ab] in the regex.
Variant 2 was used by Microsoft Corporation and is sometimes still used.