public static Rule getRule(final String field, final String pattern) {
    try {
      return new LikeRule(field, Pattern.compile(pattern, Pattern.CASE_INSENSITIVE));
    } catch (PatternSyntaxException e) {
      throw new IllegalArgumentException("Invalid LIKE rule - " + e.getMessage());
    }
  }
Create new instance.

@param field   field
@param pattern pattern
@return new instance
olv-core/src/main/java/pl/otros/logview/accept/query/org/apache/log4j/rule/LikeRule.java