Help on Subfolder creation

Post Reply
Posts: 1
Joined: 03 Mar 2023, 21:07

Help on Subfolder creation

Post by iambond » 03 Mar 2023, 21:16

Hi Team,

Can you suggest sub-folder creation as below:


is fixed and



Basically, want to save images under multiple sub-folders under /constantfolder/ based on each sub-folder name.

Site Admin
Posts: 1785
Joined: 02 Mar 2009, 17:02

Re: Help on Subfolder creation

Post by Maxim » 04 Mar 2023, 13:41

You will need to use the [ Expert ] tab, [ Use target file parent URL Regular Expression to create sub-folder ] option in the [ Sub-folders ] section of the project properties and add the following Regular Expression:

Expression: theabc\.com/(constantfolder/[^/]+)/
Result: [#1]

Basically, when you want to match a text between / and / (which is usually a folder name in any URL) - use the following RE:


So, when you want to match the first folder after a domain name (any domain name) - you can use this RE:


When you use [^...] it means: match any character until you meet any character in square brackets after the ^. And the part inside the parentheses is called a match group. You can use up to 9 of them in the Result field. For example, let's take this URL:

And the following Regular Expression:


It will match the above URL and put the following text into the match groups:

[#2]: constantfolder
[#3]: another-folder

And the Result field allows to add any custom text along with the group matches, so you can combine the group matches any way you want to create a folder name that you need. For example, if you use the following Result with the above RE:


your folder name will be:


But you can also do it like this:

[#3]-is-a-sub-folder-of-[#2] on the domain of [#1]

the folder name will be:

another-folder-is-a-sub-folder-of-constantfolder on the domain of

Post Reply