class RegexMatcher {

  public boolean validate(String dataStr, String regex) {
    if (regex == null || regex.equals("")) {
      throw new IllegalArgumentException("regex field cannot is be null or empty!");
    } else {
      Pattern p = Pattern.compile(regex);
      return validate(dataStr, p);
    }
  }

}