Change "S01E01.EpisodeName" to S01E01 - Episode Name"

A swapping-ground for Regular Expression syntax

Change "S01E01.EpisodeName" to S01E01 - Episode Name"

Postby dmunoz » Mon Apr 27, 2020 2:58 am


So I have some files labeled like so:

ShowName - S01E01.EpisodeOneName
ShowName - S01E02.EpisodeTwoName
ShowName - S01E03.EpisodeThreeName

and so one for the rest of the season.

Is there a regular expression to replace the period after the episode number with the characters " - " (a space followed by a dash followed by a space) so we get:
ShowName - S01E01 - EpisodeOneName

I tried using "(?<=E\d\d)\s" which worked on, but not with Bulk Rename or Windows PowerToys' PowerRename.


Posts: 1
Joined: Mon Apr 27, 2020 2:45 am

Re: Change "S01E01.EpisodeName" to S01E01 - Episode Name"

Postby RegexNinja » Mon Apr 27, 2020 11:29 am

Hi.. With BRU, you have to match everything in the filename (that you wanna keep).
That PositiveLookBehind is testing-left for: E##, but needs Space next, so it cant match the samples.

So even if it was like: (...)(?<=E\d\d)Space
The LookBehind lets (...) match E##, but there's no space to complete the match.
There's a new manual over at: ... =12&t=4743
It covers alot regex too.. Here's something that works for now.. Cheers.

Regex Match/Replace:
\1 - \2
Posts: 134
Joined: Fri Feb 21, 2020 5:26 pm

Return to Regular Expressions