Here you can find the source of isValidMD5(String md5)
private static boolean isValidMD5(String md5)
//package com.java2s; //License from project: Open Source License public class Main { private static boolean isValidMD5(String md5) { if (md5 == null) { return false; }// ww w.j ava2 s .c o m // Check length AND characters return md5.matches("^[0-9A-Fa-f]{32}+$"); } }