47dacd4c7c9423be2044d4307b4fca979d353816dobrou * CDDL HEADER START
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * The contents of this file are subject to the terms of the
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * Common Development and Distribution License (the "License").
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * You may not use this file except in compliance with the License.
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * See LICENSE.txt included in this distribution for the specific
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * language governing permissions and limitations under the License.
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * When distributing Covered Code, include this CDDL HEADER in each
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * file and include the License file at LICENSE.txt.
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * If applicable, add the following below this CDDL HEADER, with the
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * fields enclosed by brackets "[]" replaced with your own identifying
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * information: Portions Copyright [yyyy] [name of copyright owner]
47dacd4c7c9423be2044d4307b4fca979d353816dobrou * CDDL HEADER END
5d4e5c041325456d2db42e7a1a5a6cd64cc2c455dobrou * Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.
697eb84b62379360d04234d89b6344648af012a5dobrou * @author dobrou@gmail.com
6336b638e9afd018de5f6c516eac4775d140fdaeJHKST private static final Logger LOGGER = LoggerFactory.getLogger(RegexpMatcher.class);
697eb84b62379360d04234d89b6344648af012a5dobrou public RegexpMatcher(String term, boolean caseInsensitive) {
697eb84b62379360d04234d89b6344648af012a5dobrou regexp = Pattern.compile(term, caseInsensitive ? Pattern.CASE_INSENSITIVE : 0 );
6336b638e9afd018de5f6c516eac4775d140fdaeJHKST LOGGER.log(Level.WARNING, "RegexpMatcher: {0}", e.getMessage() );
697eb84b62379360d04234d89b6344648af012a5dobrou return (termRegexp != null && termRegexp.matcher(line).matches() )