// obviously, there is no easy regexp to validate this.
// Additionally, we require the part before the @.
// So, just some very simple validation:
final int i = target.indexOf('@');
if (i == -1) {
throw new IMMessageTargetConversionException("Invalid input for target: '" + target + "'." +
"\nDoesn't contain a @.");
} else if (target.indexOf('@', i + 1) != -1)
{
throw new IMMessageTargetConversionException("Invalid input for target: '" + target + "'." +
"\nContains more than on @.");
}
}