Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

check if string is uuid

// For test 01234567-9ABC-DEF0-1234-56789ABCDEF0 use Regex
Regex reg = new Regex("/^[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}$/");

// with brackets
Regex reg = new Regex("/^{?[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}}?$/");
// use https://regexr.com/ for a REGEX builder
 
PREVIOUS NEXT
Tagged: #check #string #uuid
ADD COMMENT
Topic
Name
5+4 =