Skip to content

Pattern matching when names contain space  #8578

@goebbe

Description

@goebbe

A Vorta user had a hard time matching a folder-name with a space on MacOS:
borgbase/vorta#2156 (reply in thread)
Since matching names that contain a single space is a common use case, I decided to report, here.

I tried to reproduce the issues using Vorta 0.10.1 with borg 1.4 on LinuxMint 22.

My folder was named test folder, with a single space in the middle of the folder-name.
I used --patterns-from with the standard sh: and the fm: matcher and tried to exclude the folder from my backup.

The following did not work:

  • Putting the file path into quotation marks (single or double).
  • Escaping the space with \.
  • Replacing the space with \s.

As code:

-'home/user/test folder'
-"home/user/test folder"
-home/user/test\ folder

In short, I did not find a simple way to match the folder name, using --pattern matching with the standard sh: or fm: matcher.

The following worked for me. However, I had to use the re: matcher (regular expressions), in order to match the single space by \s.
-re:home/user/test\sfolder

Currently, matching names with (a single) space seems not to be documented.
If this is the expected behaviour (i.e. not a bug) - maybe we could add a working example (with re:) to the docs?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions