Created
May 11, 2018 23:40
-
-
Save ppazos/37ad4ba431ec2e9831f35bfa10da28b2 to your computer and use it in GitHub Desktop.
UUID format matcher in groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def uuids = ['a4c0064a-74fc-41e2-a5e0-0492ed2d79a7', '', 'fdgsfgsg', '345'] | |
uuids.each { | |
def matcher = (it ==~ /([a-zA-Z0-9]{8}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{4}-[a-zA-Z0-9]{12})/) | |
if (matcher) println it + " OK" | |
else println it + " NO" | |
} | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment