package nl.quintor.commons.util; import java.util.regex.Pattern; /** * Utility class with generic application neutral methods. * * @author Benny Bottema */ public final class GenericUtils { /** * Private constructor; This class is not meant to be instantiated. This is a utility class with static methods * only. */ private GenericUtils() { }; /** * Checks if the given regexp pattern is applicable to the given input string. * * @param pattern The regexp pattern to check against. * @param input The input string to check against the pattern. * @return Whether the given regexp pattern is applicable to the given input string. */ public static boolean regexPatternMatches(final String pattern, final String input) { return Pattern.compile(pattern).matcher(input).matches(); } }