> Hello All.
> We are currently running CF 4.01 (don't ask).. :-)
> Anyways, I am trying to check if a value is a UUID,
> does anyone have a quick code snippet for this, or can
> someone tell me what the best way to do this would be?
I don't remember what all the specifics are for CF 4.01 ... however... a CF
generated UUID is always in the format of
C42BFC86-D99B-4F37-80EE699DEDDDB88F
XXXXXXXX-XXXX-XXXX-XXXXXXXXXXXXXXXX
where X is 0-9|A-Z ... So assuming you have REFind in 4.01 you could use
REFind(myvariable,"(0-9|A-Z){8,8}-(0-0|A-Z){4,4}-(0-9|A-Z){16,16}$")
which should return a 1 if the string is a UUID ... I believe $ is the code
for "end of string" ... wish I could remember the beginning of string code,
which you'd want to put on the beginning of the expression also ...
Otherwise, you can check the length of the string separately to make sure
it's 35 characters...
hth
Isaac
www.turnkey.to
954-776-0046
______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists