diff --git a/docs/configuration.md b/docs/configuration.md index 6529791f0..16d11e6b5 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -1360,13 +1360,16 @@ don't exist yet. #### [`PAPERLESS_CONSUMER_IGNORE_PATTERNS=`](#PAPERLESS_CONSUMER_IGNORE_PATTERNS) {#PAPERLESS_CONSUMER_IGNORE_PATTERNS} : Additional regex patterns for files to ignore in the consumption directory. Patterns are matched against filenames only (not full paths) -using Python's `re.match()`, which anchors at the start of the filename. +using Python's `re.search()`. Use `^` to anchor a pattern to the start of the filename and `$` to anchor it to the end. See the [watchfiles documentation](https://watchfiles.helpmanual.io/api/filters/#watchfiles.BaseFilter.ignore_entity_patterns) This setting is for additional patterns beyond the built-in defaults. Common system files and directories are already ignored automatically. The patterns will be compiled via Python's standard `re` module. + These are regular expressions, not glob patterns. For example, the glob pattern `._*` does not mean "starts with `._`" when used as a + regular expression; it matches nearly any non-empty filename. Use `^\._.*` for that behavior instead. + Example custom patterns: ```json @@ -1381,7 +1384,11 @@ using Python's `re.match()`, which anchors at the start of the filename. Defaults to `[]` (empty list, uses only built-in defaults). - The default ignores are `[.DS_Store, .DS_STORE, ._*, desktop.ini, Thumbs.db]` and cannot be overridden. + The built-in file patterns are equivalent to the following regular expressions and cannot be overridden: + + ```json + ["^\\.DS_Store$", "^\\.DS_STORE$", "^\\._.*", "^desktop\\.ini$", "^Thumbs\\.db$"] + ``` #### [`PAPERLESS_CONSUMER_IGNORE_DIRS=`](#PAPERLESS_CONSUMER_IGNORE_DIRS) {#PAPERLESS_CONSUMER_IGNORE_DIRS}