Groovy web console

subscribe to the feed Subscribe
to this
site
IsValidUUID (via #groovywebconsole)
tweet this snippet Tweet
this
script

IsValidUUID

Published 3 months ago by UnUser with tags uuid validation
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts
 String sUUID = "00003493-f518-4a16-86fe-d4004a154538"
 UUID uuid = UUID.fromString(sUUID);
 println(sUUID?.matches("[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}"))