class SenderIsRegex extends GenericMatcher {

    @Override
    public void init() throws MessagingException {
        String patternString = getCondition();
        if (Strings.isNullOrEmpty(patternString)) {
            throw new MessagingException("Pattern is missing");
        }
        
        patternString = patternString.trim();
        try {
            pattern = Pattern.compile(patternString);
        } catch (PatternSyntaxException mpe) {
            throw new MessagingException("Malformed pattern: " + patternString, mpe);
        }
    }

}