Here you can find the source of isUUID(String string)
public static boolean isUUID(String string)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static boolean isUUID(String string) { try {// w ww. j a v a2 s . c o m UUID.fromString(string); return true; } catch (Exception ex) { return false; } } }