class RegexpMatcher extends LineMatcher {

    private static final Logger LOGGER = LoggerFactory.getLogger(RegexpMatcher.class);

    private final Pattern termRegexp;

    RegexpMatcher(String term, boolean caseInsensitive) {
        super(caseInsensitive);
        Pattern regexp;
        try {
            regexp = Pattern.compile(term, caseInsensitive ? Pattern.CASE_INSENSITIVE : 0 );
        } catch ( PatternSyntaxException  e) {
            regexp = null;
            LOGGER.log(Level.WARNING, "RegexpMatcher: {0}", e.getMessage() );
        }
        this.termRegexp = regexp;
    }

    @Override
    public int match(String line) {<FILL_FUNCTION_BODY>}

}

        return (termRegexp != null && termRegexp.matcher(line).matches()) ? MATCHED : NOT_MATCHED;
    
<methods>public abstract int match(java.lang.String) <variables>public static final int MATCHED,public static final int NOT_MATCHED,public static final int WAIT,private final non-sealed boolean caseInsensitive