MRT: How to Removing string in brackets?

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Ruriko
Junior Member
Junior Member
Posts: 19
Joined: 2012-08-26, 12:50 UTC

MRT: How to Removing string in brackets?

Post by *Ruriko »

Hi! I'm trying to rename files by removing text inside any type of brackets and then abbreviate the rest of the filename.

So for example if a filename is (AC) Kero Kero Chime Ep 01 [E94F6701] the final output should be K_K_C_E_01_

I'm having trouble to get this result cause my final result became: (_K_K_C_E_01_

This is my settings/code:

Code: Select all

Rename mask: file name: [N1]_[N2]_[N3]_[N4]_[N5]_[N6]_[N7]_[N8]_[N9]_[N10]_[N11]_[N12]_[N13]_[N14]_[N15]_[N16]_[N17]_[N18]_[N19]_[N20]_[N21]_[N
22]_[N23]_[N24]_[N25]_[N26]_[N27]_[N28]_[N29]_[N30]_[N31]_[N32]_[N33]_[N34]_[N35]_[N36]_[N37]_[N38]_[N39]_[N40]_[N41]_
[N42]_[N43]_[N44]_[N45]_[N46]_[N47]_[N48]_[N49]_[N50]_[N51]_[N52]_[N53]_[N54]_[N55]_[N56]_[N57]_[N58]_[N59]_[N60]_[N61
]_[N62]_[N63]_[N64]_[N65]_[N66]_[N67]_[N68]_[N69]_[N70]_[N71]_[N72]_[N73]_[N74]_[N75]_[N76]_[N77]_[N78]_[N79]_[N80]_[N
81]_[N82]_[N83]_[N84]_[N85]_[N86]_[N87]_[N88]_[N89]_[N90]_[N91]_[N92]_[N93]_[N94]_[N95]_[N96]_[N97]_[N98]_[N99]_


Search for:     \[.*?\]_|(\d)_|([^\s_])_([^\s_]_)*|\s(_)|_ 
Replace with:   $1$2$4 

RegEx:          Checked 
1x (E) Subst:   Not checked 
Can anyone help me fix my coding?
User avatar
milo1012
Power Member
Power Member
Posts: 1158
Joined: 2012-02-02, 19:23 UTC

Post by *milo1012 »

Quite a mess ;)
I'm not really sure about your rules:
Apparently you want to remove everything in parentheses (round brackets) too, just like the with (square) brackets?

Also you should use a word character, instead of defining a negating character group.
Try this:

Code: Select all

\(.*?\)_\s?|\[.*?\]_|(\d)_|(\w)_(\w_)*|\s(_)|_
I'm sure that there are more problems to expect, if some of your files don't follow that very scheme.
TC plugins: PCREsearch and RegXtract
Post Reply