code: private RowFilter<TableModel, Integer> createRegexFilter(
          String regex, int columnIndex)
      {
          try
          {
              String finalRegex = regex;
              if (ignoringCase)
              {
                  finalRegex = "(?i)" + regex;
              }
              RowFilter<TableModel, Integer> rowFilter = 
                  RowFilter.regexFilter(finalRegex, columnIndex);
              return rowFilter;
          }
          catch (PatternSyntaxException e)
          {
              logger.warning(e.getMessage());
              return null;
          }
      }
docs: Create a row filter for the given regex and column. If the given
  string is not a valid regex, then a warning will be printed and
  <code>null</code> will be returned.
  
  @param regex The regex
  @param columnIndex The column index
  @return The row filter