I’m working on PHP project that interacts with HRNET and at some point I need to validate if given string is valid mssql guid. For this I use php regular expression:
^[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}$
Wish list
If you like this blog and want to say thanks in some way, here is my wish-list on Amazon. It'll be very cool to get a gift from my subscribers. Just don't forget to put your name on it -)Tags
Would this not verify GUID’s with non-hex characters in it? Like G,H,I and so on?
This would validate G, H, I etc.
For Hex-only use this: ^[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}$