Problem with regex or Bulk?

A swapping-ground for Regular Expression syntax

Problem with regex or Bulk?

Postby cyclogenesis » Mon Nov 23, 2020 10:45 am

[Episode 14] That's the Idea, Ochaco
[Episode 15] Roaring Sports Festival

Here's an example of the files I am dealing with.
I need to replace "[Epsiode 14]" with "s2e14-" to form "s2e14-That's the Idea, Ochaco"
Furthermore, "[Epsiode 15]" with "s2e15-" to form "s2e15-Roaring Sports Festival"
You can see the pattern.

I am not sure I understand how to use bulk to do this. If I need to post in another section, my apologies and I will do that.

Here is my supposed regex.

(\[Episode) ([0-9]+)(])+

This should be relevant to the "[Episode XX]" portion of the file name. I need to replace that with a auto-incrementing string to take care of "s2e14".
I figure the numbering(10) option could do this but exactly how do I implement this? Do bulk's operations happen sequentially? How can I use the regex and numbering feature together.

[Episode 14] That's the Idea, Ochaco
In this string, I need to replace "[Episode 14] with "s2e" and following that, I need to increment starting from 14. Then, insert a hyphen and finally insert the renaming episode title.
I appreciate any help. Thank you for your time.
cyclogenesis
 
Posts: 2
Joined: Mon Nov 23, 2020 10:33 am

Re: Problem with regex or Bulk?

Postby Luuk » Mon Nov 23, 2020 4:17 pm

The Regex(1) not can type \2 in the "Start" box for Numbering(10), so instead its to be manual like ...
(\[Episode) (14)(])+ (.+)
s2e-\4
with 14 to be in the "Start" box and 3 in the "at" box with careful filename selections.
Im thinking the javascript can probably conduct like your explanation, so maybe its good idea to post in javascript section?
Sorry Im not learned any of the javascipt formats yet.
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Problem with regex or Bulk?

Postby Luuk » Mon Nov 23, 2020 4:19 pm

Actually I mean the Regex(1) not can type \4 in the "Start" box, but it not lets me edit, lol.
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Problem with regex or Bulk?

Postby Luuk » Mon Nov 23, 2020 4:23 pm

Lol, I get it right the first time, \2 would go to the "Start" box. Im also thinking this could be good idea for updates in the future, because maybe \2 could be useful in the other sections as well!
Luuk
 
Posts: 690
Joined: Fri Feb 21, 2020 10:58 pm

Re: Problem with regex or Bulk?

Postby Admin » Mon Nov 23, 2020 11:33 pm

You could remove first using Remove (5) or with RegeX (1) enable Simple option then
Match : [%1] %2
Replace: %2

then Add (7) to add s2e and Numbering (10) for the counter.

Make sure files are sorted in the order of the episodes so that Numbering (10) works in the right order.
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Re: Problem with regex or Bulk?

Postby cyclogenesis » Tue Nov 24, 2020 3:19 am

Thanks! The Admin's solution works great. I guess I shouldn't have been so set on using the regexes.
cyclogenesis
 
Posts: 2
Joined: Mon Nov 23, 2020 10:33 am


Return to Regular Expressions