code: protected boolean check(String value, String regex) {
  		Pattern pattern = Pattern.compile(regex);
  		return pattern.matcher(value).matches();
  	}
docs: Check whether the value is matched by a regular expression.
  
  @param value value
  @param regex regular expression
  @return true when value is matched