gmail-processor
gmail-processor copied to clipboard
Case sensitive file extension for attachments
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
"filenameFromRegexp": ".*\.pdf$|.*\.PDF$"
@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.