Regex issue with combining expressions not working
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
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)$)
See https://github.com/sist2app/sist2/blob/master/docs/USAGE.md#excluding-files for complex exclude patterns