Closed tflinkow closed 11 months ago
Hi! First of all, thank you for sponsoring me and this project!
Since the filter .sql can be used to only extract .sql files, I tried using !.sql to exclude them from the extraction, similar to the 7z.exe -x switch.
Yeah, the current bit7z's wildcard matching system is pretty basic, and it doesn't support "negative" matching, as 7-zip does. It only supports *
and ?
wildcards.
I'm sorry, I think I should have implemented it before, and I'll probably do it in a future version.
Is there any way I can achieve my goal of not extracting .sql files, optimally without having to explicitly loop over all items and checking myself?
It should be possible to achieve it with the current bit7z version by using regular expression matching, e.g.:
extractor.extractMatchingRegex(downloadedFile, L"^(?!.*\.sql$).*$", extractionPath);
Please note that, by default, bit7z is compiled without regex support. For enabling it, you should compile the library by defining the flag BIT7Z_REGEX_MATCHING
(e.g., using CMake, cmake [...] -DBIT7Z_REGEX_MATCHING=ON
). You will also need to define the same flag before including the bit7z header files.
Feature description
I use the following code to extract all files from a
.7z
that are not.sql
files.Since the filter
*.sql
can be used to only extract.sql
files, I tried using!*.sql
to exclude them from the extraction, similar to the7z.exe -x
switch.However, this filter throws an exception:
Am I doing something wrong? Is there any way I can achieve my goal of not extracting
.sql
files, optimally without having to explicitly loop over all items and checking myself?Additional context
No response
Code of Conduct