Regular expression to create subdirectories

Post Reply
superchicken
Posts: 1
Joined: 30 Apr 2015, 19:08

Regular expression to create subdirectories

Post by superchicken » 30 Apr 2015, 19:40

Regular expressions have eluded me... I need to know, what would be the regular expression to use to create sub-drectories named after the original album name on imagefap.

example:

http://www.imagefap.com/pictures/539833 ... Cappotelli

Out of this url, I'd like to make a sub-directory named Tiffany Cappotelli without the hyphen.

Maksym
Site Admin
Posts: 2077
Joined: 02 Mar 2009, 17:02

Re: Regular expression to create subdirectories

Post by Maksym » 03 May 2015, 14:30

Well, EPF doesn't offer "replace" functionality with Regular Expresions, only "match" is available. So, if you want a generic RE for this case that would be:

RE: /\d+/(.+?)$
Result: [#1]

But if you know that all gallerie names will consist of 2 words and a hyphen between them, then you could use this one:

RE: /\d+/(.+?)-(.+?)$
Result: [#1] [#2]

Post Reply