Pattern matching

Ventoo Document Merger uses wildcard pattern matching to determine which files to include or exclude from the merge composition. Pattern matching applies to rules with the source types Document Attachment and Incoming Document.

File name pattern

The File Name Pattern field on a rule defines which files to include based on their name. If left blank, all files are included.

Supported wildcards

Wildcard

Description

Example

*

Matches any number of characters (including zero).

Contract* matches "Contract", "Contract_2024.pdf", "Contract-signed.pdf"

?

Matches exactly one character.

Report_?.pdf matches "Report_A.pdf", "Report_1.pdf" but not "Report_AB.pdf"

Examples

Pattern

Matches

Does not match

*

All files

-

Contract*

Contract.pdf, Contract_signed.pdf

Invoice.pdf

*Invoice*

Sales_Invoice.pdf, Invoice_001.pdf

Contract.pdf

Report_????.pdf

Report_0001.pdf, Report_2024.pdf

Report_1.pdf, Report_12345.pdf

*.pdf

Document.pdf, Image.pdf

Document.jpg

Note Pattern matching is case-insensitive. The pattern contract* matches both "Contract.pdf" and "contract.pdf".

Exclude file name pattern

The Exclude File Name Pattern field defines files to exclude, even if they match the file name pattern. This field supports multiple comma-separated patterns.

Examples

File Name Pattern

Exclude Pattern

Result

*

Draft*

All files except those starting with "Draft"

*

Draft*,Temp*,Internal*

All files except Draft, Temp, and Internal prefixed files

Contract*

*_old*

Contract files except those containing "_old"

File type filter

The File Type Filter field filters files by their extension. Enter one or more extensions without the dot, separated by commas.

Examples

Filter

Matches

pdf

Only PDF files

pdf,jpg

PDF and JPG files

pdf,jpg,png

PDF, JPG, and PNG files

(blank)

All file types

Combining filters

All three filters are applied together. A file must match all of the following conditions to be included:

  1. The file name matches the File Name Pattern (or the pattern is blank).

  2. The file name does not match any of the Exclude File Name Patterns.

  3. The file extension matches the File Type Filter (or the filter is blank).

Example

A rule with the following configuration:

  • File Name Pattern: *

  • Exclude File Name Pattern: Draft*,Internal*

  • File Type Filter: pdf

This includes all PDF files except those whose names start with "Draft" or "Internal".