class RegExpConditionCheckerOperator implements ConditionCheckerOperator {

    @Override
    public boolean checkTarget(final String regExp, final String target) {
        boolean result = false;
        if (!"".equals(regExp)) {
            try {
                Pattern pattern = patternFactory.createPattern(regExp);
                Matcher matcher = pattern.matcher(target);
                if (matcher.find()) {
                    result = true;
                }
            } catch (Exception e) {
                throw new RegularExpressionEvaluationException("Regular expression evaluation failed with the expression: " + regExp, e);
            }
        }
        return result;
    }

}