I am trying to input a text file that contains MD5 hashes and keywords (one per line) into a C# app. Is there a way to check if a string is an MD5 hash? I looked on MSDN a
Use Regex like this:
public static bool IsMD5(string input) { if (String.IsNullOrEmpty(input)) { return false; } return Regex.IsMatch(input, "^[0-9a-fA-F]{32}$", RegexOptions.Compiled); }