Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect filter behavior when combining multiple regexp #5053

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Jojo-1000
Copy link
Contributor

Closes #4590

With multiple regexp filters, if an earlier filter matches only part of a path, any other filters were ignored.

Steps to reproduce

  • Create/choose folders /a/, /b/ and /a/c/ (names irrelevant)
  • Run test-filters command with regexp include filter expression [/(a|b)/] and [/a/c/] and exclude .*
Duplicati.CommandLine.exe test-filters  /a --include="[/(a|b)/]" --include="[/a/c/]" --exclude="[/.*/]"
  • See also FilterTests.CombineRegexp

Current behavior

  • The regexp expressions are combined to (/(a|b)/)|(/a/c/), which will match the part /a/ of /a/c/. This is detected as a mismatch, so the path is excluded.

New behavior

  • The regexp expressions are combined to ^((^(/(a|b)/)$)|(^(/a/c/)$))$ (not ideal in terms of delimiters, but works). This forces the match to the full path /a/c/. The path is included as it should be.

Closes duplicati#4590

With multiple regexp filters, if an earlier filter matches only part of a path, any other filters were ignored.
@Jojo-1000 Jojo-1000 changed the title Fix incorrect filter behavior when combining multiple regexp. Fix incorrect filter behavior when combining multiple regexp Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regexp Include filter ignored but identical filter without regexp [] works
1 participant