Regular Expression for renaming folder names carrying .com

A swapping-ground for Regular Expression syntax

Regular Expression for renaming folder names carrying .com

Postby BRUVC » Wed Oct 19, 2016 9:34 pm

Hello,
I got a bunch of folders all carrying different names (including the . character at multiple occurrences) but ending with a common and constant text

_ABC.com

at the end of each folder name ( I added the line breaks for clarity at the post and nothing much). So we have 2 parts for every folder.

Part 1: Folder Name that includes . character at multiple positions
Part 2: _ABC.com

So an example folder name would be : Ex1.Ex2.Ex3_ABC.com which am splitting (for the sake of my question clarity)

Part 1: Ex1.Ex2.Ex3
Part 2: _ABC.com

Whatever expression I tried including escape characters - they all worked good for renaming the text
Ex1.Ex2.Ex3_ABC
with zero effect to the last .com characters.

My expectation on the renamed folder name (it should not carry the last .com text):
Ex1.Ex2.Ex3_ABC

Any chance you can help me with
1) a way or an expression to get this rename-folder(s) task succeeded ?
2) and also the command line equivalent to get this working ?

Thanks in advance,

VC
BRUVC
 
Posts: 1
Joined: Wed Oct 19, 2016 9:19 pm

Re: Regular Expression for renaming folder names carrying .com

Postby therube » Thu Oct 20, 2016 12:56 am

Are you missing, Renaming Options | Ignore -> Folder Extensions ?
Check or uncheck as needed.

11: Extension -> Remove
would need Folder Extensions, unchecked.

3: Replace
Replace: .com
With: {null}
would need Folder Extensions, checked.


(The Ignore settings are backwards to my way of thinking. And at the moment, I'm not putting my head around the differences needed for what I described above?)
therube
 
Posts: 1314
Joined: Mon Jan 18, 2016 6:23 pm

Re: Regular Expression for renaming folder names carrying .com

Postby Admin » Thu Oct 20, 2016 2:12 am

I think the 'ignore' options would better be renamed to 'include' ... e.g. 'Include File Extensions' or 'Apply renaming criteria to file extensions too' ....
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm


Return to Regular Expressions