reg expression favorite

Would you like Bulk Rename Utility to offer new functionality? Post your comments here!

reg expression favorite

Postby snaky » Wed Aug 24, 2005 12:04 pm

hi

i activated the "save favorites on exit" and "store pathname"

everytime i start Bulk Rename Utility it loads the last active favorite. thats all right, but my regular expression is not saved right.

my RegEx at the moment
Code: Select all
(.*)(-mod|-fmc|-udc|-uc|-esc|-fwyh|-rns|-csr|-sms|-for_www_goldesel.to|-nbd|-ser|-mip|-xxl|-rod|-syndikat|-c4|-krbz|-bmi|-imc|-rda|-osc|-snd|-amok|-bacardi|-hb|-qmi|-fnt|-tan|-jce|-sq|-whoa|-rikskrim|-mvp|-idc|-phear|-xxx|-oma|-nuc|-www.goldesel.to|-khz|-ck|-ksi|-sut|-aes|-jrp|-gti|-rtb|-bf| - torrentazos.com|-www.MP3-Es.com|-omni|-kzt|-scratch|-aec|-tn)


everytime i start it in the first field is
Code: Select all
(.*)(-mod|-fmc|-udc|-uc|-esc|-fwyh|-rns|-csr|-sms|-for_www_goldesel.to|-nbd|-ser|-mip|-xxl|-rod|-syndikat|-c4|-krbz|-bmi|-imc|-rda|-osc|-snd|-amok|-bacardi|-hb|-qmi|-fnt|-tan|-jce|-sq|-whoa|-rikskrim|-mvp|-idc|-phear|-xxx|-oma|-nuc|-www.goldesel.to|-khz|-ck|-


I think that's something wrong in the favorites save, because he restores only 260 letters.
can you please expand it in the next version ?

greetz
snaky

p.s.:sorry for my bad english, it's not my motherlanguage
snaky
 
Posts: 6
Joined: Wed Aug 24, 2005 11:41 am

Postby Admin » Wed Aug 24, 2005 12:36 pm

Hi Snaky,

I can't even begin to imagine what that RegExp is doing, it looks a nightmare!

However, I can tell you that it is limited to 260 characters. This is a restriction of the Windows API function WritePrivateProfileString, so it's not something I can change. I will look to see if there is an alternative API call.


Jim
Admin
Site Admin
 
Posts: 2343
Joined: Tue Mar 08, 2005 8:39 pm

Postby snaky » Wed Aug 24, 2005 12:59 pm

this reg exp is actually for mp3 files. mostly the mp3's had in the end letters from crews or sites.

for example
04 artist - title-nbd.mp3
23 the artist - the title-aes.mp3

with this reg exp i check the last charakters after the last "-".
if the last charakters found in the reg exp it will be deleted (the last letters). in the match field is only "\1". so i have a "clean" filename.

for example:
04 artist - title.mp3
23 the artist - the title.mp3

because not every "crew-tag" is only 3 digits/letters wide i had to change it with reg exp to enter the tags he may delete.

if someone have a better idea for solving the problem i'm open for new :D

thanks for fast reply
greetz snaky
snaky
 
Posts: 6
Joined: Wed Aug 24, 2005 11:41 am

Postby Stefan » Thu Aug 25, 2005 7:19 pm

04 artist - title-nbd.mp3

(.+) - (.+)(-.+)
\1 - \2

04 artist - title.mp3


===== means =========
(.+) - (.+)(-.+)
FIRST search till   'space minus space'
THAN search till   'non-space minus'

Sure if you have an title such as "Moon-River-ndb.mp3"
this regex will not work correct 'cus it will delete the hole '-River-ndb'
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Postby Stefan » Thu Aug 25, 2005 7:22 pm

And if you want to use your regex
you could split it by "|-xxx"
and s & r two times ?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU

Postby snaky » Sat Aug 27, 2005 9:37 am

thanks i'll try it
Stefan wrote:And if you want to use your regex
you could split it by "|-xxx"
and s & r two times ?


what do you mean with "and s & r two times ?"

Admin wrote:However, I can tell you that it is limited to 260 characters. This is a restriction of the Windows API function WritePrivateProfileString, so it's not something I can change. I will look to see if there is an alternative API call.

when i enter the "too long" RegEx, the RegEx does their work. the only Problem is the saving to file.

greetz
snaky
 
Posts: 6
Joined: Wed Aug 24, 2005 11:41 am

Postby Stefan » Sat Aug 27, 2005 10:17 pm

snaky wrote:thanks i'll try it
Stefan wrote:And if you want to use your regex
you could split it by "|-xxx"
and s & r two times ?


what do you mean with "and s & r two times ?"

greetz


I mean split your regex in two parts
so you could save this two parts easily as favorites
and than simple search and replace (s&r) two times,
first with the first half of your regex, than with the second part.

(of course not only split it... but make two regex from your one)

It's not sooo nifty 'cus you have to do 2 searches,
but this way you could save your regex as favorites.

HTH :?
Stefan
 
Posts: 736
Joined: Fri Mar 11, 2005 7:46 pm
Location: Germany, EU


Return to Suggestions