code: public static boolean match(Object value1, Object value2) {
  		if (value1 == null && value2 == null)
  			return true;
  		if (value1 == null || value2 == null)
  			return false;
  
  		String string1 = value1.toString();
  		String string2 = value2.toString();
  		return string1.matches(string2);
  	}
docs: Checks if string matches a regular expression
  
  @param value1  a string value to match
  @param value2 a regular expression string
  @return true if the value matches regular expression and false otherwise.