Java examples for java.util.regex:Match Date Time
is Date by Regex, one format
import java.util.regex.Pattern; public class Main{ /* w ww . j av a 2 s. c o m*/ public static boolean isDate(String input) { if (StringUtil.isEmpty(input)) { return false; } return input.matches("\\d{1,4}-\\d{1,2}-\\d{1,2}"); } }