I was calling an API which requires UUID version 4 to set as one of the headers. I decided to use this website ( https://www.uuidgenerator.net/ ) API to generate the UUID which works fine.
Later, I started looking for ways to generate the UUID v4 internally in the app so I came across this...
This code is to check if a string is a valid GUID.
Sub IsGuid(GUID As String) As Boolean
Return Regex.IsMatch("^(\{){0,1}[0-9a-fA-F]{8}\-" & _
"[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-" & _
"[0-9a-fA-F]{12}(\}){0,1}$", GUID)
End Sub
Source...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.