sist2 icon indicating copy to clipboard operation
sist2 copied to clipboard

Regex issue with combining expressions not working

Open kousha789123 opened this issue 2 years ago • 2 comments

Please see https://regex101.com/r/NJB1K4/1

This regex that has | in it should work in scan, but it is not working. I am using the UI for my scan purposes (the logs clearly show the problem is with the operator |

The first part of the regex ^..(?!pdf$)[^.]$ works nicely and the second part of the regex after | works too separately. if it helps you understand what regex is trying to do: it is excluding any file that doesn't end in PDF and it is excluding any files that is not starting with 2024-11 (Nov. month).

Just create the file names listed in the regex101 link on the system and check. It has taken me at least a day to find this bug. thanks

kousha789123 avatar Nov 13 '24 05:11 kousha789123

If you are getting an error can you post it?

Also, try grouping, so something like this: (^.*\.(?!pdf$)[^.]*$)|(^(?!2024-11).*$)

Here is one that I use to exclude MS Word temp files and various other file extensions: (.*\~.*)|(.*\.(dat|wbk|tmp|db|zdp|ini|ttf|ai|lnk)$)

dpieski avatar Dec 26 '24 21:12 dpieski

See https://github.com/sist2app/sist2/blob/master/docs/USAGE.md#excluding-files for complex exclude patterns

shyyio avatar Jul 05 '25 23:07 shyyio