gmail-processor icon indicating copy to clipboard operation
gmail-processor copied to clipboard

Case sensitive file extension for attachments

Open sactyr opened this issue 3 years ago • 1 comments

First, thank you for the great script - it works beautifully.

I tried editing the rules for file extension so that it's not case sensitive e.g. it accepts both .pdf and .PDF

"filenameFromRegexp": "..pdf$" to "filenameFromRegexp": ".(?i).pdf$"

and I am getting the following error in the execution log: SyntaxError: Invalid regular expression: /.*(?i).pdf$/: Invalid group

For the life of me I can't figure out what's the correct syntax, anyone with better regex skills? Thanks

sactyr avatar Apr 15 '21 05:04 sactyr

"filenameFromRegexp": ".*\.pdf$|.*\.PDF$"

zzzZZZzzz9 avatar Nov 30 '21 09:11 zzzZZZzzz9

@sactyr Gmail2Gdrive did not support passing regex modifier flags in the config. Please migrate to it's successor Gmail Processor which added support for this feature in release v2.4.0. In your case the relevant matching config would look like this:

"match": {
  "name": "(?i)\\.pdf$"
}

Also note, that Gmail Processor provides a lot more features like capturing multiple parts of the string and using them to construct the file location in GDrive.

ahochsteger avatar Oct 13 '23 05:10 ahochsteger