Skip to main content.
home | support | download

Back to List Archive

Re: problem with "FileFilter"-tag

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Sun Mar 17 2002 - 14:55:35 GMT
At 07:42 AM 03/15/02 -0800, Andreas Rann wrote:
>I must use a "FileFilter"- program for all files without an extension.
>Is there a possibility to set the "FileFilter"-tag for this case?

I've added a new config option for using regular expressions for applying
files.

[This documentation is *not* correct because you need to use
double-backslashs.  This may or many not change in the near future.]


    FileFilterMatch *filter-prog* *filter-options* *regex* [*regex* ...]
        This is similar to `FileMatch' except uses regular expressions to
        match against the file name. *filter-prog* is the path the 
        program. Unlike `FileFilter' this does not use the `FilterDir'
        option. Also unlike `FileFilter' you must specify the
        *filter-options*.

        Examples:

            FileFilterMatch ./pdftotext "'%p' -" /\.pdf$/

        Note that will also match a file called ".pdf", so you may want
        to use something that requires a filename that has more than just an
        extension:

            FileFilterMatch ./pdftotext "'%p' -" /.\.pdf$/

        To specify more than one extension:

            FileFilterMatch ./check_title.pl "%p" /\.html$/  /\.htm$/
    
        Or a few ways to do the same thing:

            FileFilterMatch ./check_title.pl %p /\.(html|html)$/
            FileFilterMatch ./check_title.pl %p /\.html?$/

        And to ignore case:

            FileFilterMatch ./check_title.pl %p /\.html?$/i

        You may also precede an expression with "not" to negate regular
        expression that follow. For example, to match files that do not have
        an extension:

            FileFilterMatch ./convert "%p %P" not /\..+$/


Again, these examples are wrong at this moment.  At this time you would
want to use double-backslashes:

            FileFilterMatch ./convert "%p %P" not /\\..+$/

I'm not sure if this will change.  If it does I'll post a message on the
swish-e list.


-- 
Bill Moseley
mailto:moseley@hank.org
Received on Sun Mar 17 14:55:45 2002