Group files based on regex/custom code

What is the problem you are having with rclone?

I have a folder with lot of files, I want them to be copied to a remote(s3) with sub-folders based on each file name.
eg: source file is AK_ABD-S2-ABCD1-XZ_WE17_20200380300255.txt

I want this to be converted to:

  1. Is there a way to apply my custom regex to filename to decide how to store on the remote?
  2. I can also provide list of source and their corresponding destination files on remote using a python script.
  3. Is there a way I can write my custom functions/modules and ask rclone to execute them to generate/change destination filename?

rclone v1.55.1