private static Filter getExportFilter(String[] args) {
    Filter exportFilter;
    String filterCriteria = (args.length > 5) ? args[5] : null;
    if (filterCriteria == null) return null;
    if (filterCriteria.startsWith("^")) {
      String regexPattern = filterCriteria.substring(1, filterCriteria.length());
      exportFilter = new RowFilter(CompareOperator.EQUAL, new RegexStringComparator(regexPattern));
    } else {
      exportFilter = new PrefixFilter(Bytes.toBytesBinary(filterCriteria));
    }
    return exportFilter;
  }
Common usage for other export tools.
@param errorMsg Error message. Can be null.
hbase-mapreduce/src/main/java/org/apache/hadoop/hbase/mapreduce/ExportUtils.java