How do I get BRU to ignore brackets "[]" in folder

A swapping-ground for Regular Expression syntax

How do I get BRU to ignore brackets "[]" in folder

Postby coyotewrw » Mon Apr 24, 2006 4:25 pm

Hi all,

I have some folders with the following naming convention:

"D:\MUSIC\Chieftains\1987 - Chieftains in Ireland - [w James Galway]"

I want to change them to this, using regular expressions:

"D:\MUSIC\Chieftains\1987 - Chieftains in Ireland - [w Galway, James]"

However, the brackets are messing things up. Can anyone show me how to do this correctly?

Thanks!

PS: The reason I use brackets in the names is for multiple notes, i.e:
" - [remastered] [UK release] [Live]"
This makes it easier to do a database search.
coyotewrw
 
Posts: 10
Joined: Thu Mar 02, 2006 6:08 am

Postby Admin » Mon Apr 24, 2006 11:12 pm

Hi,

Using your SPECIFIC example, you would use the following:

Match: (.*)(\[)(.*)(\s)(.*)(\])

Replace: \1\2\3, \5\6


Hopefully this will allow you to arrive at something more generic.



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

Postby coyotewrw » Mon Apr 24, 2006 11:24 pm

@Jim:

Thanks, worked perfectly. :)

EDIT: I spoke too soon. I just took a second look and saw that it's only putting a comma between the first and last names, not also swapping them ("first, last" instead of the correct "last, first").

I'll keep playing with it, but could you also have another go? Thanks again...


EDIT2: I was able to get it working:

(.*)(\[w )(.*)(\s)(.*)(\])
\1\2\5, \3\6

I failed to mention earlier that the "[w" means "[with". Anyway, thanks for the clues to get it done. :)
coyotewrw
 
Posts: 10
Joined: Thu Mar 02, 2006 6:08 am

Postby Admin » Tue Apr 25, 2006 6:57 am

Ok, glad you got it working. You can now see the technique.


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


Return to Regular Expressions