I am working on a Cocoa iOS application that has a reserve - if the user does not enter a certain part of the data, the device UDID is used instead, by default. I need to add a check to our server code (written in Ruby) to find out if the value being sent is UDID (user default) or the custom string they set.
It seems like the correct solution to my problem is regex. I am comfortable writing regex'es, but I have to make sure that this regular expression is 100% guaranteed to recognize UDIDs.
I am extracting the UDID in the code using:
[[UIDevice currentDevice] uniqueIdentifier]
And in the simulator I will return this value:
6938CA7D-ECE2-53A4-B293-961A8D07AFB1
From this, I can conclude that I can just look for a string of hexadecimal characters that matches the pattern 8-4-4-4-12. But I want to be sure that this works for every UDID.
I can't find anything about this in the Apple documentation and was wondering if anyone could give me a definitive answer to this question ... thanks!
source
share