public boolean validate(final String hex, String type) {
		if(type.equalsIgnoreCase("email"))
			matcher = EmailPattern.matcher(hex);
		if(type.equalsIgnoreCase("username"))
			matcher = UsernamePattern.matcher(hex);
		return matcher.matches();
	}