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

Regex issue with combining expressions not working #500

Open
kouroshshafi opened this issue Nov 13, 2024 · 1 comment
Open

Regex issue with combining expressions not working #500

kouroshshafi opened this issue Nov 13, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@kouroshshafi
Copy link

kouroshshafi commented Nov 13, 2024

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

@kouroshshafi kouroshshafi added the bug Something isn't working label Nov 13, 2024
@dpieski
Copy link
Contributor

dpieski commented Dec 26, 2024

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)$)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants