agave-apps/apps-core/src/main/java/org/iplantc/service/apps/util/ServiceUtils.java
/**
	 * Utility function to verify a string value against a given regex.
	 * 
	 * @param value string value to test.
	 * @param regex the regex to test
	 * @return true if validator is null or the string matches. false otherwise
	 */
Utility function to verify a string value against a given regex.

@param value string value to test.
@param regex the regex to test
@return true if validator is null or the string matches. false otherwise
Utility function to verify a string value against a given regex . @param value string value to test . @param regex the regex to test @return true if validator is null or the string matches . false otherwise
public static boolean doesValueMatchValidatorRegex(String value, String regex)
	{
		if (StringUtils.isEmpty(regex) || value == null) {
			return true;
		}
		else 
		{
			try 
			{
				Regex r = new Regex();
				r.compile(regex);
				return r.search(value);
			}
			catch (Throwable e) {
				return false;
			}
		}
	}
public static boolean doesValueMatchValidatorRegex ( String value , String regex ) { if ( StringUtils . isEmpty ( regex ) || value == null ) { return true ; } else { try { Regex r = new Regex ( ) ; r . compile ( regex ) ; return r . search ( value ) ; } catch ( Throwable e ) { return false ; } } }
Utility function to verify a string value against a given regex.
Utility function to verify a string value against a given regex .