Java tutorial
//package com.java2s; public class Main { private static boolean isValidRegex(String regex) { return regex != null && !regex.isEmpty() && regex.length() > 2; } }